-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.py
executable file
·123 lines (103 loc) · 3.11 KB
/
constants.py
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import pygame
DEFAULT_SETTINGS = {
'music': True,
'sound': True,
'debug': False,
'hot_swap': True
}
# cheats
INFINITE_HEALTH = False
DATA_DIR = "data"
USER_DATA_DIR = "user_data"
TILE_SIZE = 50
HORIZONTAL_TILES = 16
VERTICAL_TILES = 16
RESOLUTION_X = TILE_SIZE * HORIZONTAL_TILES
RESOLUTION_Y = TILE_SIZE * VERTICAL_TILES
DEFAULT_TEXT_COLOR = pygame.Color(200, 200, 200)
SELECTED_TEXT_COLOR = pygame.Color(255, 200, 200)
DEBUG_LEVEL_LOAD_TIME = 200
LEVEL_LOAD_TIME = 2000
# the time in milliseconds before a screen responds to input
SCREEN_CHANGE_COOLDOWN = 1000
COLOR_TRANSPARENT = pygame.Color(0, 0, 0, 0)
TILE_WALL_COLOR = pygame.Color(150, 0, 0, 255)
TILE_GROUND_COLOR = pygame.Color(100, 100, 100, 255)
# Bullet
# speed in tiles per second
BULLET_SPEED = 5.0
BULLET_WIDTH_RATIO = 0.2
BULLET_HEIGHT_RATIO = 0.1
BULLET_COLOR = pygame.Color(20, 20, 150, 255)
# tank
# this is the number of seconds it takes to make one complete rotation
TANK_TURNING_SPEED = 9.0
TURRET_TURNING_SPEED = 3.0
# the acceleration, deceleration, and natural deceleration rate in
# tiles per second^2
ACCEL_SPEED = 0.6
DECEL_SPEED = 0.6
NEUTRAL_SPEED = 0.6
# max speed in tiles per second
MAX_SPEED = 1.2
# the size of the tank relative to a tile
TANK_SIZE_RATIO = 0.8
TURRET_LENGTH_RATIO = 0.6
TURRET_WIDTH_RATIO = 0.2
TANK_COLOR = pygame.Color(20, 150, 20, 255)
ENEMY_TANK_COLOR = pygame.Color(20, 150, 150, 255)
TANK_HEALTH = 3
SHOCKWAVE_DURATION = 600
SHOCKWAVE_MIN_RATIO = 0.2
SHOCKWAVE_MAX_RATIO = 0.5
BIG_EXPLOSION_MAX_RATIO = 1.0
BIG_EXPLOSION_MIN_RATIO = 0.2
EXPLOSION_MAX_RATIO = 0.5
EXPLOSION_MIN_RATIO = 0.1
EXPLOSION_DURATION = 200
TANK_MAX_BULLETS = 3
TANK_MAX_MINES = 3
# number of milliseconds required between firings
TANK_COOLDOWN = 500
TANK_MINE_COOLDOWN = 1000
# the max range of a bullet in tiles before it explodes
BULLET_MAX_RANGE = 15.0
POWERUP_SIZE_RATIO = 0.6
POWERUP_COLOR_MODULATION_TIME = 1000
POWERUP_COLOR_ONE = pygame.Color(100, 0, 0, 255)
POWERUP_COLOR_TWO = pygame.Color(0, 0, 100, 255)
POWERUP_EXPLODE_TIME = 500
POWERUP_ACCEL = 5
POWERUP_PARTICLES = 8
POWERUP_PARTICLE_AMPLITUDE_RATIO = 0.1
POWERUP_PARTICLE_PERIOD_RATIO = 1.0
POWERUP_PARTICLE_AGE = 2000
POWERUP_PARTICLE_INIT_SPEED = 3
POWERUP_PARTICLE_DECEL = 1.5
TRAIL_PARTICLE_AGE = 500
TRAIL_FREQUENCY = 100
SHIELD_PULSE_PERIOD = 2000
SHIELD_RADIUS_RATIO = 0.6
SHIELD_COLOR = pygame.Color(0, 0, 100, 100)
SHIELD_COLOR_TWO = pygame.Color(0, 0, 200, 100)
SHIELD_GROWTH_TIME = 200
SHIELD_DEATH_TIME = 200
SHIELD_PULSE_COLOR = pygame.Color(100, 100, 100, 255)
SPLASH_TANK_DURATION = 10000
SPLASH_TANK_COLOR_PERIOD = 2000
SPLASH_TANK_COLOR = pygame.Color(150, 150, 20)
MINE_SIZE_RATIO = 0.3
MINE_COLOR_MODULATION_TIME = 800
MINE_COLOR_ONE = pygame.Color(100, 0, 100, 255)
MINE_COLOR_TWO = pygame.Color(0, 100, 0, 255)
MINE_DETECTION_RATIO = 0.8
MINE_EXPLOSION_DURATION = 800
MINE_MAX_SIZE_RATIO = 0.6
MINE_EXPLODING_COLOR = pygame.Color(255, 0, 0, 255)
MINE_ACTIVE_AGE = 3000
MINE_NON_ACTIVE_PULSE_PERIOD = 1000
MINE_NON_ACTIVE_PULSE_LENGTH = 500
MINE_PULSE_COLOR_ONE = pygame.Color(150, 0, 0, 255)
MINE_PULSE_COLOR_TWO = pygame.Color(0, 0, 150, 255)
MINE_DOOTS = 4
MINE_MAX_AGE = 15000