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