1 import pygame.locals as pgl
3 from naja.attrdict import AttrDict
19 FREQ = 44100 # same as audio CD
20 BITSIZE = -16 # unsigned 16 bit
21 CHANNELS = 2 # 1 == mono, 2 == stereo
22 BUFFER = 1024 # audio buffer size in no. of samples
23 DEFAULT_SOUND_VOLUME = 1.0 # sound volume
24 DEFAULT_MUSIC_VOLUME = 0.3 # music volume
39 DIRECTION_BITS = AttrDict((k, v) for k, v in BITS.items() if v < 4)
40 CONDITION_BITS = AttrDict((k, v) for k, v in BITS.items() if v >= 4)
43 PLAYER_DEFAULTS = AttrDict({
45 'INITIAL_POS': (2, 2),
53 BOARD_SIZE = (5 * TILE_SIZE[0], 5 * TILE_SIZE[1])
54 BIT_SIZE = (5 * TILE_SIZE[0], (SCREEN[1] - 5 * TILE_SIZE[1]) // 2)
55 INFO_SIZE = (SCREEN[0] - 5 * TILE_SIZE[0], SCREEN[1])
56 PLAYER_SIZE = (64, 96)
64 'UP': (pgl.K_UP, pgl.K_w, pgl.K_COMMA),
65 'DOWN': (pgl.K_DOWN, pgl.K_s, pgl.K_o),
66 'LEFT': (pgl.K_LEFT, pgl.K_a),
67 'RIGHT': (pgl.K_RIGHT, pgl.K_d, pgl.K_e),
68 'NOMOVE': (pgl.K_SPACE,),
70 'SELECT': (pgl.K_RETURN, pgl.K_KP_ENTER),
71 'QUIT': (pgl.K_ESCAPE, pgl.K_q),
72 'SWITCH': (pgl.K_TAB,),