1 import pygame.locals as pgl
3 from naja.attrdict import AttrDict
16 # We calculate the default in options.py
25 FREQ = 44100 # same as audio CD
26 BITSIZE = -16 # unsigned 16 bit
27 CHANNELS = 2 # 1 == mono, 2 == stereo
28 BUFFER = 1024 # audio buffer size in no. of samples
29 DEFAULT_SOUND_VOLUME = 1.0 # sound volume
30 DEFAULT_MUSIC_VOLUME = 0.3 # music volume
33 DIRECTION_BITS = AttrDict({
39 CONDITION_BITS = AttrDict({
46 BITS.update(DIRECTION_BITS)
47 BITS.update(CONDITION_BITS)
58 CHESS_PIECES = AttrDict((k, v) for k, v in MOVES.items() if v > 0)
66 PLAYER_DEFAULTS = AttrDict({
68 'INITIAL_POS': (2, 2),
76 SMALL_LOCK_HEIGHT = 24
77 BOARD_SIZE = (5 * TILE_SIZE[0], 5 * TILE_SIZE[1])
78 BIT_SIZE = (5 * TILE_SIZE[0], (SCREEN[1] - 5 * TILE_SIZE[1]) // 2)
79 INFO_SIZE = (SCREEN[0] - 5 * TILE_SIZE[0], SCREEN[1])
80 INFO_LEFT_PADDING = 18
81 PLAYER_SIZE = (64, 96)
82 ACTION_TEXT_OFFSET = 20
89 'UP': (pgl.K_UP, pgl.K_w, pgl.K_COMMA),
90 'DOWN': (pgl.K_DOWN, pgl.K_s, pgl.K_o),
91 'LEFT': (pgl.K_LEFT, pgl.K_a),
92 'RIGHT': (pgl.K_RIGHT, pgl.K_d, pgl.K_e),
93 'NOMOVE': (pgl.K_SPACE,),
95 'SELECT': (pgl.K_RETURN, pgl.K_KP_ENTER),
96 'QUIT': (pgl.K_ESCAPE, pgl.K_q),
97 'SWITCH': (pgl.K_TAB,),
100 pgl.K_UP, pgl.K_DOWN, pgl.K_LEFT, pgl.K_RIGHT, pgl.K_a, pgl.K_b),
118 'DARK_RED': (108, 41, 64),
119 'DARK_VIOLET': (64, 53, 120),
120 'MAGENTA': (217, 60, 240),
121 'DARK_GREEN': (19, 87, 64),
122 'GREY': (128, 128, 128),
123 'BLUE': (38, 151, 240),
124 'LIGHT_VIOLET': (191, 180, 248),
125 'DARK_OLIVE': (64, 75, 7),
126 'ORANGE': (217, 104, 15),
127 'PINK': (236, 168, 191),
128 'GREEN': (38, 195, 15),
129 'LIGHT_OLIVE': (191, 202, 135),
130 'LIGHT_TURQUOISE': (147, 214, 191),
131 'WHITE': (255, 255, 255),
135 ACTION_GLYPHS = AttrDict({
136 'CLEAR_BITS': 'glyphs/bits_clear.png',
137 'TOGGLE_BITS': 'glyphs/bits_toggle.png',
138 'SET_BITS': 'glyphs/bits_set.png',
139 'CHANGE_BOARD': 'glyphs/board.png',
140 'DAMAGE': 'glyphs/damage.png',
141 'HEAL': 'glyphs/health.png',
142 'MOVEMENT': 'glyphs/move.png',
143 'WINTOKEN': 'glyphs/win.png',
144 'MSB': 'glyphs/msb.png',
145 'NOTHING': 'glyphs/do_nothing.png',
146 'SHIFT_LEFT': 'glyphs/shift_left.png',
147 'SHIFT_RIGHT': 'glyphs/shift_right.png',