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 INFO_RIGHT_PADDING = 18
82 PLAYER_SIZE = (64, 96)
83 ACTION_TEXT_OFFSET = 20
90 'UP': (pgl.K_UP, pgl.K_w, pgl.K_COMMA),
91 'DOWN': (pgl.K_DOWN, pgl.K_s, pgl.K_o),
92 'LEFT': (pgl.K_LEFT, pgl.K_a),
93 'RIGHT': (pgl.K_RIGHT, pgl.K_d, pgl.K_e),
94 'NOMOVE': (pgl.K_SPACE,),
96 'SELECT': (pgl.K_RETURN, pgl.K_KP_ENTER),
97 'QUIT': (pgl.K_ESCAPE, pgl.K_q),
98 'SWITCH': (pgl.K_TAB,),
101 pgl.K_UP, pgl.K_DOWN, pgl.K_LEFT, pgl.K_RIGHT, pgl.K_a, pgl.K_b),
119 'DARK_RED': (108, 41, 64),
120 'DARK_VIOLET': (64, 53, 120),
121 'MAGENTA': (217, 60, 240),
122 'DARK_GREEN': (19, 87, 64),
123 'GREY': (128, 128, 128),
124 'BLUE': (38, 151, 240),
125 'LIGHT_VIOLET': (191, 180, 248),
126 'DARK_OLIVE': (64, 75, 7),
127 'ORANGE': (217, 104, 15),
128 'PINK': (236, 168, 191),
129 'GREEN': (38, 195, 15),
130 'LIGHT_OLIVE': (191, 202, 135),
131 'LIGHT_TURQUOISE': (147, 214, 191),
132 'WHITE': (255, 255, 255),
136 ACTION_GLYPHS = AttrDict({
137 'CLEAR_BITS': 'glyphs/bits_clear.png',
138 'TOGGLE_BITS': 'glyphs/bits_toggle.png',
139 'SET_BITS': 'glyphs/bits_set.png',
140 'CHANGE_BOARD': 'glyphs/board.png',
141 'DAMAGE': 'glyphs/damage.png',
142 'HEAL': 'glyphs/health.png',
143 'MOVEMENT': 'glyphs/move.png',
144 'WINTOKEN': 'glyphs/win.png',
145 'MSB': 'glyphs/msb.png',
146 'NOTHING': 'glyphs/do_nothing.png',
147 'SHIFT_LEFT': 'glyphs/shift_left.png',
148 'SHIFT_RIGHT': 'glyphs/shift_right.png',
159 # Puzzles, because resources can't give us file lists