-
Notifications
You must be signed in to change notification settings - Fork 11
/
constants.py
84 lines (77 loc) · 1.55 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
"""Module to contain constants."""
# General constants #
BACKGROUND_COLOUR = 1
SCORE_COLOUR = 7
DEATH_COLOUR = 0
DEATH_STRIP_COLOUR = 8
DEATH_TEXT_COLOUR = 0
DEATH_HEIGHT = 134
INITIAL_SPAWN_FREQUENCY = 300
SPAWN_FREQUENCY_MOVEMENT = 0.9
HIGH_SCORE_FILE = "score.txt"
SOUND_FILE = "sound.pyxres"
# Ship related constants #
SHIP_COLOUR = 6
SHIP_INITIAL_POSITION = (100, 100)
SHIP_POINTS = [(0, -8), (4, 4), (0, 2), (-4, 4)]
SHIP_ACCELERATION_POINTS = 6, 13
SHIP_ACCELERATION_COLOUR = 10
ROTATION = 0.1
DRAG = 0.98
ACCELERATION = 0.4
MAX_ACCELERATION = 6
SHIP_RADIUS = 4
BUFFER = 7
SHIP_DRIFT_VELOCITY = 0.6
SHIP_BREAKUP_ROTATION = 0.01
SHIP_BREAKUP_DRAG = 0.997
# Bullet related constants #
BULLET_COLOUR = 14
BULLET_VELOCITY = 5
BULLET_RADIUS = 1
BULLET_SHOOT_FREQUENCY = 5
# Asteriod related constants #
ASTEROID_COLOUR = 13
ASTEROID_INITIAL_QUANTITY = 3
ASTEROID_ROTATION = 0.02
ASTEROID_RADIUS = 16
ASTERPOD_INITIAL_SIZE = 2
ASTEROID_SPLITS = 3
ASTEROID_VELOCITY = 0.7
ASTEROID_BUFFER = 16
ASTEROID_SPAWN_BUFFER = SHIP_RADIUS + ASTEROID_RADIUS * 2
ASTEROID_SHAPES = [
[
(0, 15),
(4, 9),
(11, 5),
(15, 1),
(5, -3),
(0, -14),
(-6, -4),
(-17, -4),
(-12, 9),
],
[
(1, 16),
(6, 12),
(6, 6),
(17, 2),
(9, -12),
(1, -17),
(-4, -2),
(-18, -4),
(-11, 8),
],
[
(0, 17),
(7, 10),
(4, 8),
(14, -1),
(5, -2),
(1, -16),
(-6, -2),
(-16, -4),
(-11, 6),
],
]