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
27 DIRECTION_BITS = AttrDict({
33 CONDITION_BITS = AttrDict({
40 BITS.update(DIRECTION_BITS)
41 BITS.update(CONDITION_BITS)
52 CHESS_PIECES = AttrDict((k, v) for k, v in MOVES.items() if v > 0)
55 PLAYER_DEFAULTS = AttrDict({
57 'INITIAL_POS': (2, 2),
66 BOARD_SIZE = (5 * TILE_SIZE[0], 5 * TILE_SIZE[1])
67 BIT_SIZE = (5 * TILE_SIZE[0], (SCREEN[1] - 5 * TILE_SIZE[1]) // 2)
68 INFO_SIZE = (SCREEN[0] - 5 * TILE_SIZE[0], SCREEN[1])
69 PLAYER_SIZE = (64, 96)
76 'UP': (pgl.K_UP, pgl.K_w, pgl.K_COMMA),
77 'DOWN': (pgl.K_DOWN, pgl.K_s, pgl.K_o),
78 'LEFT': (pgl.K_LEFT, pgl.K_a),
79 'RIGHT': (pgl.K_RIGHT, pgl.K_d, pgl.K_e),
80 'NOMOVE': (pgl.K_SPACE,),
82 'SELECT': (pgl.K_RETURN, pgl.K_KP_ENTER),
83 'QUIT': (pgl.K_ESCAPE, pgl.K_q),
84 'SWITCH': (pgl.K_TAB,),
91 'DARK_RED': (108, 41, 64),
92 'DARK_VIOLET': (64, 53, 120),
93 'MAGENTA': (217, 60, 240),
94 'DARK_GREEN': (19, 87, 64),
95 'GREY': (128, 128, 128),
96 'BLUE': (38, 151, 240),
97 'LIGHT_VIOLET': (191, 180, 248),
98 'DARK_OLIVE': (64, 75, 7),
99 'ORANGE': (217, 104, 15),
100 'PINK': (236, 168, 191),
101 'GREEN': (38, 195, 15),
102 'LIGHT_OLIVE': (191, 202, 135),
103 'LIGHT_TURQUOISE': (147, 214, 191),
104 'WHITE': (255, 255, 255),
107 ACTION_GLYPHS = AttrDict({