forked from OpenBMB/ChatDev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.py
More file actions
63 lines (56 loc) · 1.48 KB
/
constants.py
File metadata and controls
63 lines (56 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import pygame
from enum import Enum
# Window Settings
WINDOW_WIDTH = 1080
WINDOW_HEIGHT = 900
CELL_SIZE = 100
GRID_ROWS = 7
GRID_COLS = 9
TOP_MARGIN = 100
FPS = 60
# Colors
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
GREEN = (0, 255, 0)
DARK_GREEN = (0, 100, 0)
BROWN = (139, 69, 19)
YELLOW = (255, 255, 0)
LAWN_GREEN = (124, 252, 0)
GRAY = (128, 128, 128)
RED = (255, 0, 0)
# Game States
class GameState(Enum):
MENU = 1
PLAYING = 2
PAUSED = 3
GAME_OVER = 4
# Plant Types
class PlantType(Enum):
SUNFLOWER = 1
PEASHOOTER = 2
ROSE_SHOOTER = 3
CHOMPER = 4
SNOW_PEA = 5
# Zombie Types
class ZombieType(Enum):
NORMAL = 1
CONE = 2
BUCKET = 3
NEWSPAPER = 4
DANCING = 5
# Plant Stats
PLANT_STATS = {
PlantType.SUNFLOWER: {"health": 100, "cost": 50, "color": YELLOW},
PlantType.PEASHOOTER: {"health": 120, "cost": 100, "color": GREEN},
PlantType.ROSE_SHOOTER: {"health": 140, "cost": 150, "color": (255, 192, 203)},
PlantType.CHOMPER: {"health": 180, "cost": 175, "color": (148, 0, 211)},
PlantType.SNOW_PEA: {"health": 130, "cost": 175, "color": (0, 191, 255)}
}
# Zombie Stats
ZOMBIE_STATS = {
ZombieType.NORMAL: {"health": 300, "speed": 0.4, "damage": 0.4},
ZombieType.CONE: {"health": 450, "speed": 0.45, "damage": 0.3},
ZombieType.BUCKET: {"health": 550, "speed": 0.35, "damage": 0.5},
ZombieType.NEWSPAPER: {"health": 200, "speed": 0.6, "damage": 0.3},
ZombieType.DANCING: {"health": 350, "speed": 0.5, "damage": 0.35}
}