75 lines
1.2 KiB
Python
75 lines
1.2 KiB
Python
from enum import Enum
|
|
|
|
GAME_TITLE = 'WMICraft'
|
|
WINDOW_HEIGHT = 800
|
|
WINDOW_WIDTH = 1360
|
|
FPS_COUNT = 60
|
|
TURN_INTERVAL = 300
|
|
|
|
GRID_CELL_PADDING = 5
|
|
GRID_CELL_SIZE = 36
|
|
ROWS = 19
|
|
COLUMNS = 24
|
|
|
|
BORDER_WIDTH = 10
|
|
BORDER_RADIUS = 5
|
|
|
|
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
|
|
|
|
CASTLE_SPAWN_WIDTH = 6
|
|
CASTLE_SPAWN_HEIGHT = 5
|
|
CASTLE_SPAWN_FIRST_ROW = 7
|
|
CASTLE_SPAWN_FIRST_COL = 9
|
|
|
|
NBR_OF_WATER = 16
|
|
NBR_OF_TREES = 20
|
|
NBR_OF_MONSTERS = 2
|
|
NBR_OF_SANDS = 35
|
|
|
|
TILES = [
|
|
'grass1.png',
|
|
'grass2.png',
|
|
'grass3.png',
|
|
'grass4.png',
|
|
'sand.png',
|
|
'water.png',
|
|
'grass_with_tree.jpg',
|
|
]
|
|
|
|
|
|
class Direction(Enum):
|
|
UP = 0
|
|
RIGHT = 1
|
|
DOWN = 2
|
|
LEFT = 3
|
|
|
|
def right(self):
|
|
v = (self.value + 1) % 4
|
|
return Direction(v)
|
|
|
|
def left(self):
|
|
v = (self.value - 1) % 4
|
|
return Direction(v)
|
|
|
|
|
|
ACTION = {
|
|
"rotate_left": -1,
|
|
"rotate_right": 1,
|
|
"go": 0,
|
|
}
|
|
|
|
# HEALTH_BAR
|
|
BAR_ANIMATION_SPEED = 1
|
|
BAR_WIDTH_MULTIPLIER = 0.9 # (0;1>
|
|
BAR_HEIGHT_MULTIPLIER = 0.1
|
|
|
|
LEFT = 'LEFT'
|
|
RIGHT = 'RIGHT'
|
|
UP = 'UP'
|
|
DOWN = 'DOWN'
|