-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModuleScene.h
217 lines (177 loc) · 4.44 KB
/
ModuleScene.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
#pragma once
#include "Module.h"
#include "p2List.h"
#include "p2Point.h"
#include "Globals.h"
#include "Animation.h"
class PhysBody;
struct GroundAsset {
int x;
int y;
SDL_Rect rect;
bool isActive;
};
class ModuleScene : public Module
{
public:
// Constructors & Destructors
ModuleScene(Application* app, bool start_enabled = true);
~ModuleScene();
void initTextures();
void initMapCollisions();
void drawScene();
void drawScore();
void drawAnimations();
void doRayCast();
void ResetTable();
void switchLayer(int newLayer);
// Main module steps
bool Start();
update_status Update();
update_status PostUpdate();
bool CleanUp();
public:
int currentLayer;
// Lists of physics objects
// Map Textures
SDL_Texture* mapLayer0;
SDL_Texture* mapLayer1;
SDL_Texture* mapLayer2;
SDL_Texture* mapLayer3;
SDL_Texture* assetsTexture;
// Assets for the Map
// Arrows
GroundAsset greenArrow1;
GroundAsset greenArrow2;
GroundAsset greenArrow3;
GroundAsset blueArrow1;
GroundAsset blueArrow2;
GroundAsset blueArrow3;
GroundAsset redArrow1;
GroundAsset redArrow2;
GroundAsset redArrow3;
// H-O-L-E Letters
GroundAsset holeLight1;
GroundAsset holeLight2;
GroundAsset holeLight3;
GroundAsset holeLight4;
// Dots
GroundAsset dotsLight1;
GroundAsset dotsLight2;
GroundAsset dotsLight3;
// Lives
GroundAsset livesLight1;
GroundAsset livesLight2;
GroundAsset livesLight3;
// Pelipper button counter.
GroundAsset counterNo1;
GroundAsset counterNo2;
GroundAsset counterNo3;
p2List<GroundAsset*> groundAssets;
// map collisions
// 0
PhysBody* mapCollisionLake0;
PhysBody* mapCollisionMarket0;
PhysBody* mapCollisionMarketRail0;
PhysBody* mapCollisionLeft0;
PhysBody* mapCollisionRight0;
PhysBody* mapCollisionGeneral0;
PhysBody* mapCollisionTopRectA0;
PhysBody* mapCollisionTopRectB0;
p2List<PhysBody*> mapCollisionsLayer0;
// 1
PhysBody* mapCollisionLeftRailA1;
PhysBody* mapCollisionLeftRailB1;
PhysBody* mapCollisionRightRailA1;
PhysBody* mapCollisionRightRailB1;
p2List<PhysBody*> mapCollisionsLayer1;
// 2
PhysBody* mapCollisionRigthRail2;
PhysBody* mapCollisionTopRail2;
p2List<PhysBody*> mapCollisionsLayer2;
// Animation (Pelipper button)
Animation pButton;
Animation* pButtonAnim = nullptr;
// Animations (Yellow arrows)
Animation martArrow;
Animation* martArrowAnim = nullptr;
Animation bumperArrow;
Animation* bumperArrowAnim = nullptr;
Animation catchArrow;
Animation* catchArrowAnim = nullptr;
Animation hatchArrow;
Animation* hatchArrowAnim = nullptr;
// Animations (Screen)
Animation screen;
Animation* screenAnim = nullptr;
// Animations (Wailmer)
SDL_Texture* wailmerTexture;
Animation wailmerIdle;
Animation wailmerSpit;
Animation* wailmerAnim = nullptr;
// Animations (Wailmer pit)
Animation wailmerPit;
Animation* wailmerPitAnim = nullptr;
// Animations (Seedot)
SDL_Texture* seedotTexture;
Animation seedotIdle;
Animation* seedotAnim = nullptr;
Animation basketIdle;
Animation* basketAnim = nullptr;
// Animations (Pelipper)
SDL_Texture* pelipperTexture;
Animation pelipperIdle;
Animation pelipperBack;
Animation* pelipperAnim = nullptr;
// Animations (Zigzagoon)
SDL_Texture* zigzagoonTexture;
Animation zigzagoonIdle;
Animation zigzagoonDance;
Animation* zigzagoonAnim = nullptr;
// Animations (Minun)
SDL_Texture* minunTexture;
Animation minunIdle;
Animation minunJump;
Animation* minunAnim = nullptr;
// Animations (Plusle)
SDL_Texture* plusleTexture;
Animation plusleIdle;
Animation plusleJump;
Animation* plusleAnim = nullptr;
// Animations (Minun & Plusle lightning)
SDL_Texture* lightningTexture;
Animation lightningPlusle;
Animation lightningMinun;
Animation* lightPlusleAnim = nullptr;
Animation* lightMinunAnim = nullptr;
// Score variables
unsigned int currentScore = 0;
unsigned int previousScore = 0;
unsigned int highestScore = 0;
int pelipperMultiplier = 1;
float seedotMultiplier = 1.0f;
int evoMultiplier = 0;
int getMultiplier = 0;
int ballMultiplier = 1;
// Game variables
int lives = 3;
bool plusleTrigger = false;
bool minunTrigger = false;
bool pelipperTrigger = false;
bool zigzagoonTrigger = false;
bool pikachuTrigger = false;
bool wailmerTrigger = false;
bool evoTopFlag = false;
bool evoBotFlag = false;
bool getTopFlag = false;
bool getBotFlag = false;
bool upLeftFlag = false;
bool upMidFlag = false;
bool upRightFlag = false;
bool hasGivenLife = false;
// Font
int font;
// Raycast
p2Point<int> ray;
bool ray_on;
};