projects
/
naja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move the player.
[naja.git]
/
naja
/
constants.py
diff --git
a/naja/constants.py
b/naja/constants.py
index d8087d617fb2168a1e3385d4e41e3546d55b26ac..45ffa3c0b6a065ea9cad4d30a982e11d1c5d12b5 100644
(file)
--- a/
naja/constants.py
+++ b/
naja/constants.py
@@
-5,6
+5,7
@@
SCREEN = (800, 600)
FPS = 40
FONT = 'DejaVuSans.ttf'
FONT_SIZE = 16
FPS = 40
FONT = 'DejaVuSans.ttf'
FONT_SIZE = 16
+EIGHT_BIT_SCALE = 4
DEFAULTS = dict(
debug=False,
DEFAULTS = dict(
debug=False,
@@
-23,17
+24,30
@@
DEFAULT_MUSIC_VOLUME = 0.3 # music volume
# Player bits
BITS = AttrDict({
# Direction bits
# Player bits
BITS = AttrDict({
# Direction bits
- 'NORTH':
0
,
- 'SOUTH':
1
,
- 'EAST':
2
,
- 'WEST':
3
,
+ 'NORTH':
1
,
+ 'SOUTH':
2
,
+ 'EAST':
4
,
+ 'WEST':
8
,
# Condition bits
# Condition bits
- 'CYAN':
4
,
- 'MAGENTA':
5
,
- 'YELLOW': 6,
- 'MSB':
7
,
+ 'CYAN':
16
,
+ 'MAGENTA':
32
,
+ 'YELLOW': 6
4
,
+ 'MSB':
128
,
})
DIRECTION_BITS = AttrDict((k, v) for k, v in BITS.items() if v < 4)
CONDITION_BITS = AttrDict((k, v) for k, v in BITS.items() if v >= 4)
})
DIRECTION_BITS = AttrDict((k, v) for k, v in BITS.items() if v < 4)
CONDITION_BITS = AttrDict((k, v) for k, v in BITS.items() if v >= 4)
+# Player defaults
+PLAYER_DEFAULTS = AttrDict({
+ 'INITIAL_BITS': BITS.NORTH | BITS.SOUTH | BITS.EAST | BITS.WEST,
+ 'INITIAL_POS': (2, 2),
+ 'MAX_HEALTH': 4,
+ 'WINS_REQUIRED': 4,
+})
+
+# Game size constants
TILE_SIZE = (96, 96)
TILE_SIZE = (96, 96)
+BOARD_SIZE = (5 * TILE_SIZE[0], 5 * TILE_SIZE[1])
+BIT_SIZE = (5 * TILE_SIZE[0], (SCREEN[1] - 5 * TILE_SIZE[1]) // 2)
+INFO_SIZE = (SCREEN[0] - 5 * TILE_SIZE[0], SCREEN[1])
+PLAYER_SIZE = (64, 96)