first commit

This commit is contained in:
Lukas Nöllemeyer 2024-08-16 17:20:07 +02:00
commit 85be45e2b8
18 changed files with 605 additions and 0 deletions

36
game/constants.py Normal file
View file

@ -0,0 +1,36 @@
"""Global constants are stored here."""
from typing import Final
from tcod.event import KeySym
DIRECTION_KEYS: Final = {
# Arrow keys
KeySym.LEFT: (-1, 0),
KeySym.RIGHT: (1, 0),
KeySym.UP: (0, -1),
KeySym.DOWN: (0, 1),
# Arrow key diagonals
KeySym.HOME: (-1, -1),
KeySym.END: (-1, 1),
KeySym.PAGEUP: (1, -1),
KeySym.PAGEDOWN: (1, 1),
# Keypad
KeySym.KP_4: (-1, 0),
KeySym.KP_6: (1, 0),
KeySym.KP_8: (0, -1),
KeySym.KP_2: (0, 1),
KeySym.KP_7: (-1, -1),
KeySym.KP_1: (-1, 1),
KeySym.KP_9: (1, -1),
KeySym.KP_3: (1, 1),
# VI keys
KeySym.h: (-1, 0),
KeySym.l: (1, 0),
KeySym.k: (0, -1),
KeySym.j: (0, 1),
KeySym.y: (-1, -1),
KeySym.b: (-1, 1),
KeySym.u: (1, -1),
KeySym.n: (1, 1),
}