-
Notifications
You must be signed in to change notification settings - Fork 1
/
constants.py
69 lines (48 loc) · 1.31 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
from pygame import font
# todo: consider resizing window if height of resolution is less than sufficient:
# from pygame import display
# RES_WIDTH, RES_HEIGHT = display.Info().current_w, display.Info().current_h
SCREENH = 800
SCREENW = 640
LEFT = 0
RIGHT = 1
UP = 2
DOWN = 3
BLACK = (0, 0, 0)
BOSSHEALTH = 300
PLAYERHEALTH = 3
# speed of map scrolling
SCROLLSPEED = 30
MAXSCROLLSPEED = 180
STATMOD_DURATION = 15 # seconds
PLAYERSPEED = 150
PLAYERMAXSPEED = 270
BULLETSPEED = 300
STATMOD_SPEED = 90
EXPLOSION_FRAME_UPDATE_WAIT = 0.2 # time between explosion frames in seconds
# number of saucers initially
INITIAL_SAUCERS = 3
# seconds between additional saucer spawns
NEW_SAUCER_IVAL = 15
# most saucers that can be in play before boss comes out
SAUCER_THRESHOLD = 10
BOSS_SPEED = 70
NUM_BOSS_EXPLOSIONS = 10
VAL_TEXT_SIZE = 20
SAUCER_DEATH_SCORE_INC = 5
BOSS_DEATH_SCORE_INC = 300
# todo: improve font and color
VAL_FONT = font.SysFont("monospace", VAL_TEXT_SIZE)
TEXTCOLOR = (255, 255, 0)
TEXTCOLOR_WHITE = (255, 255, 255)
VAL_X_LOC = 10
VAL_Y_LOC_START = 20
LEVEL_START_TEXT_SIZE = 72
LVL_START_FONT = font.SysFont("monospace", LEVEL_START_TEXT_SIZE)
# time in seconds to show level start announcement text
LVL_START_TIME = 1
SCORE_FILE = "hiscore.txt"
# layers
TEXT_LAYER = 1
GAMEOBJ_LAYER = 0
MAP_LAYER = -1