1 import pygame.locals as pgl
3 from naja.attrdict import AttrDict
21 FREQ = 44100 # same as audio CD
22 BITSIZE = -16 # unsigned 16 bit
23 CHANNELS = 2 # 1 == mono, 2 == stereo
24 BUFFER = 1024 # audio buffer size in no. of samples
25 DEFAULT_SOUND_VOLUME = 1.0 # sound volume
26 DEFAULT_MUSIC_VOLUME = 0.3 # music volume
29 DIRECTION_BITS = AttrDict({
35 CONDITION_BITS = AttrDict({
42 BITS.update(DIRECTION_BITS)
43 BITS.update(CONDITION_BITS)
54 CHESS_PIECES = AttrDict((k, v) for k, v in MOVES.items() if v > 0)
62 PLAYER_DEFAULTS = AttrDict({
64 'INITIAL_POS': (2, 2),
72 SMALL_LOCK_HEIGHT = 24
73 BOARD_SIZE = (5 * TILE_SIZE[0], 5 * TILE_SIZE[1])
74 BIT_SIZE = (5 * TILE_SIZE[0], (SCREEN[1] - 5 * TILE_SIZE[1]) // 2)
75 INFO_SIZE = (SCREEN[0] - 5 * TILE_SIZE[0], SCREEN[1])
76 INFO_LEFT_PADDING = 18
77 PLAYER_SIZE = (64, 96)
78 ACTION_TEXT_OFFSET = 20
85 'UP': (pgl.K_UP, pgl.K_w, pgl.K_COMMA),
86 'DOWN': (pgl.K_DOWN, pgl.K_s, pgl.K_o),
87 'LEFT': (pgl.K_LEFT, pgl.K_a),
88 'RIGHT': (pgl.K_RIGHT, pgl.K_d, pgl.K_e),
89 'NOMOVE': (pgl.K_SPACE,),
91 'SELECT': (pgl.K_RETURN, pgl.K_KP_ENTER),
92 'QUIT': (pgl.K_ESCAPE, pgl.K_q),
93 'SWITCH': (pgl.K_TAB,),
100 'DARK_RED': (108, 41, 64),
101 'DARK_VIOLET': (64, 53, 120),
102 'MAGENTA': (217, 60, 240),
103 'DARK_GREEN': (19, 87, 64),
104 'GREY': (128, 128, 128),
105 'BLUE': (38, 151, 240),
106 'LIGHT_VIOLET': (191, 180, 248),
107 'DARK_OLIVE': (64, 75, 7),
108 'ORANGE': (217, 104, 15),
109 'PINK': (236, 168, 191),
110 'GREEN': (38, 195, 15),
111 'LIGHT_OLIVE': (191, 202, 135),
112 'LIGHT_TURQUOISE': (147, 214, 191),
113 'WHITE': (255, 255, 255),
117 ACTION_GLYPHS = AttrDict({
118 'CLEAR_BITS': 'glyphs/bits_clear.png',
119 'TOGGLE_BITS': 'glyphs/bits_toggle.png',
120 'SET_BITS': 'glyphs/bits_set.png',
121 'CHANGE_BOARD': 'glyphs/board.png',
122 'DAMAGE': 'glyphs/damage.png',
123 'HEAL': 'glyphs/health.png',
124 'MOVEMENT': 'glyphs/move.png',
125 'WINTOKEN': 'glyphs/win.png',
126 'MSB': 'glyphs/msb.png',
127 'NOTHING': 'glyphs/do_nothing.png',