WMICraft/common/constants.py

65 lines
1.0 KiB
Python
Raw Normal View History

2022-04-11 00:01:57 +02:00
from enum import Enum
2022-03-09 16:59:58 +01:00
GAME_TITLE = 'WMICraft'
WINDOW_HEIGHT = 800
WINDOW_WIDTH = 1360
2022-04-10 20:28:50 +02:00
FPS_COUNT = 60
2022-04-11 00:01:57 +02:00
TURN_INTERVAL = 1000
2022-04-10 20:28:50 +02:00
2022-03-09 16:59:58 +01:00
GRID_CELL_PADDING = 5
2022-04-10 20:28:50 +02:00
GRID_CELL_SIZE = 36
2022-03-09 16:59:58 +01:00
ROWS = 19
COLUMNS = 24
2022-04-10 20:28:50 +02:00
2022-03-09 16:59:58 +01:00
BORDER_WIDTH = 10
BORDER_RADIUS = 5
2022-04-10 20:28:50 +02:00
2022-03-21 20:30:02 +01:00
KNIGHTS_SPAWN_WIDTH = 4
KNIGHTS_SPAWN_HEIGHT = 7
LEFT_KNIGHTS_SPAWN_FIRST_ROW = 6
LEFT_KNIGHTS_SPAWN_FIRST_COL = 0
RIGHT_KNIGHTS_SPAWN_FIRST_ROW = 6
RIGHT_KNIGHTS_SPAWN_FIRST_COL = 20
2022-03-24 16:32:14 +01:00
CASTLE_SPAWN_WIDTH = 6
CASTLE_SPAWN_HEIGHT = 5
CASTLE_SPAWN_FIRST_ROW = 7
CASTLE_SPAWN_FIRST_COL = 9
2022-04-10 20:28:50 +02:00
NBR_OF_WATER = 16
NBR_OF_TREES = 20
NBR_OF_MONSTERS = 2
2022-04-11 19:18:03 +02:00
NBR_OF_SANDS = 15
2022-04-10 20:28:50 +02:00
2022-03-09 16:59:58 +01:00
TILES = [
'grass1.png',
'grass2.png',
'grass3.png',
2022-04-10 20:28:50 +02:00
'grass4.png',
2022-03-09 16:59:58 +01:00
'sand.png',
'water.png',
'grass_with_tree.jpg',
2022-03-11 19:42:17 +01:00
]
2022-04-11 00:01:57 +02:00
class Direction(Enum):
UP = 0
RIGHT = 1
DOWN = 2
LEFT = 3
2022-04-11 12:00:15 +02:00
def right(self):
2022-04-11 00:01:57 +02:00
v = (self.value + 1) % 4
return Direction(v)
2022-04-11 12:00:15 +02:00
def left(self):
2022-04-11 00:01:57 +02:00
v = (self.value - 1) % 4
return Direction(v)
ACTION = {
"rotate_left": -1,
"rotate_right": 1,
"go": 0,
}