forked from Press-Play-On-Tape/Choplifter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnums.h
245 lines (210 loc) · 5.02 KB
/
Enums.h
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
#pragma once
#include "src/utils/Arduboy2Ext.h"
#define _DEBUG
#define _BLADE_SOUNDS
enum class GameState : uint8_t {
Initialise,
Introduction,
Sortie,
PlayGame,
GameOver
};
enum class TankState : uint8_t {
Dead1,
Dead2,
Dead3,
Move_Left,
Move_Right,
Stationary
};
enum class TurrentDirection : uint8_t {
Left_Low,
Left_Mid,
Upright,
Right_Mid,
Right_Low
};
enum class HelicopterStance : int8_t {
Right_Incline_Rotate_3 = -20,
Right_Incline_Rotate_2,
Right_Incline_Rotate_1,
Right_Reverse_Incline_5 = -17,
Right_Reverse_Incline_4,
Right_Reverse_Incline_3,
Right_Reverse_Incline_2,
Right_Reverse_Incline_1 = -13,
Right_Front_Incline_2 = -12,
Right_Front_Incline_1,
Right_Level_Rotate_3 = -9,
Right_Level_Rotate_2,
Right_Level_Rotate_1,
Right_Incline_Max = -6,
Right_Incline_4,
Right_Incline_3,
Right_Incline_2,
Right_Incline_1,
Right_Level = -1,
Left_Level = 1,
Left_Incline_1,
Left_Incline_2,
Left_Incline_3,
Left_Incline_4,
Left_Incline_Max = 6,
Left_Level_Rotate_1,
Left_Level_Rotate_2,
Left_Level_Rotate_3,
Front_Level = 10,
Left_Front_Incline_1,
Left_Front_Incline_2,
Left_Reverse_Incline_1 = 13,
Left_Reverse_Incline_2,
Left_Reverse_Incline_3,
Left_Reverse_Incline_4,
Left_Reverse_Incline_5,
Left_Incline_Rotate_1 = 18,
Left_Incline_Rotate_2,
Left_Incline_Rotate_3,
Set_Delta_X_Decrease = 51,
Set_Delta_X_Increase = 52,
Set_Delta_X_Zero = 53,
};
enum class AbsHelicopterStance : uint8_t {
Side_Level = 1,
Side_Incline_1,
Side_Incline_2,
Side_Incline_3,
Side_Incline_4,
Side_Incline_Max = 6,
Side_Level_Rotate_1,
Side_Level_Rotate_2,
Side_Level_Rotate_3,
Side_Front_Level = 10,
Side_Front_Incline_1,
Side_Front_Incline_2,
Side_Reverse_Incline_1 = 13,
Side_Reverse_Incline_2,
Side_Reverse_Incline_3,
Side_Reverse_Incline_4,
Side_Reverse_Incline_5 = 17,
Side_Incline_Rotate_1,
Side_Incline_Rotate_2,
Side_Incline_Rotate_3,
};
enum class HostageStance : uint8_t {
In_Dorm,
Running_Left_1,
Running_Left_2,
Running_Left_3,
Running_Left_4,
Running_Right_1,
Running_Right_2,
Running_Right_3,
Running_Right_4,
Waving_11,
Waving_12,
Waving_21,
Waving_22,
Leaving_Dorm,
Dead,
Dying_1,
Dying_2,
Safe,
In_Helicopter
};
enum class ExplosionType : uint8_t {
None,
Small,
Medium,
Both_None,
Both_Small,
Both_Medium,
Large_1,
Large_2,
Large_3,
Large_4,
Large_End
};
enum class DormitoryState : uint8_t {
Intact,
Open
};
struct Helicopter {
HelicopterStance stance;
int16_t xPos;
int8_t yPos;
int8_t xDelta;
int8_t yDelta;
uint8_t prevTurn;
uint8_t hits;
uint8_t countDown; // used when dying;
uint8_t xInc;
};
struct Bullet {
int16_t xPos;
uint8_t yPos;
int8_t xDelta;
uint8_t yDelta;
uint8_t startYPos;
};
struct BulletExplosion {
int16_t xPos;
uint16_t yPos;
ExplosionType explosionType;
};
struct Hostage {
HostageStance stance;
uint8_t countDown;
int16_t xPos;
};
struct Dormitory {
DormitoryState state;
int16_t xPos;
uint8_t numberOfHits;
};
struct Tank {
TankState state;
TurrentDirection turrentDirection;
uint8_t countDown;
int16_t xPos;
int16_t startingXPos;
bool track;
uint8_t numberOfHits;
};
#define INTRODUCTION_DELAY 65
#define LEVEL_EASY 1
#define LEVEL_HARD 2
#define NUMBER_OF_PLAYER_BULLETS 6
#define NUMBER_OF_HOSTAGES 64
#define NUMBER_OF_DORMITORIES 4
#define NUMBER_OF_TANKS 5
#define NUMBER_OF_SORTIES 3
#define NUMBER_OF_TANK_BULLETS 2
#define BULLET_INACTIVE_X_VALUE 5000
#define BULLET_SHOOT_HORIZONTAL 255
#define HELICOPTER_MAXIMUM_HEIGHT (int8_t)-3
#define HELICOPTER_MINIMUM_HEIGHT (int8_t)40
#define HELICOPTER_HOSTAGE_CAPACITY 16
#define HELICOPTER_BULLET_NUMBER_OF_HITS 3
#define PREV_TURN_FROM_LEFT 0
#define PREV_TURN_FROM_RIGHT 1
#define DELTA_X_DO_NOTHING 0
#define DELTA_X_INCREASE 1
#define DELTA_X_DECREASE 2
#define DORMITORY_HITS_REQUIRED 5
#define DORMITORY_SPACING 400
#define DORMITORY_SPACING_HALF DORMITORY_SPACING / 2
#define DORMITORY_HOSTAGE_CAPACITY 16
#define HOSTAGE_FAR_RIGHT_POS 210
#define HOSTAGE_FAR_LEFT_POS 2130
#define TANK_SPACING DORMITORY_SPACING
#define TANK_BULLET_MIN_Y_VALUE 25
#define TANK_BULLET_NUMBER_OF_HITS_EASY 4
#define TANK_BULLET_NUMBER_OF_HITS_HARD 6
#define TANK_FAR_RIGHT_POS 225
#define TANK_WIDTH 30
#define HELICOPTER_COUNT_DOWN_INACTIVE 0
#define HELICOPTER_COUNT_DOWN_START 1
#define HELICOPTER_COUNT_DOWN_MID 3
#define HELICOPTER_COUNT_DOWN_END 30
#define HELICOPTER_END_OF_GAME_START 50
#define HELICOPTER_END_OF_GAME_END 75