WMICraft/common/constants.py

70 lines
1.1 KiB
Python
Raw Permalink 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-12 20:21:29 +02:00
TURN_INTERVAL = 300
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-13 18:35:02 +02:00
NBR_OF_SANDS = 35
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 17:51:46 +02: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,
}
2022-04-28 14:13:59 +02:00
# HEALTH_BAR
2022-04-11 17:51:46 +02:00
BAR_ANIMATION_SPEED = 1
2022-04-28 14:13:59 +02:00
BAR_WIDTH_MULTIPLIER = 0.9 # (0;1>
BAR_HEIGHT_MULTIPLIER = 0.1