-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathModuleSceneLvl3.h
More file actions
97 lines (74 loc) · 2.07 KB
/
ModuleSceneLvl3.h
File metadata and controls
97 lines (74 loc) · 2.07 KB
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
#ifndef __MODULESCENELVL3_H__
#define __MODULESCENELVL3_H__
#include "Module.h"
#include "Animation.h"
#include "Globals.h"
#include "p2Point.h"
#define MAXWAVES 17
#define NUMREFLECTIONS 4
#define MAX_SCENE_COLLIDERS 20
struct SDL_Texture;
struct Collider;
enum stage_zone
{
level,
boss_zone
};
class ModuleSceneLvl3 : public Module
{
public:
ModuleSceneLvl3();
~ModuleSceneLvl3();
bool Init(); //to define needed values
bool Start();
update_status PreUpdate();
update_status Update();
update_status PostUpdate(); // sea waves
bool CleanUp();
bool spawnOnce = true;
Uint32 wave = 1;
bool midBossSpawn = false;
//void spawnEnemies(int x, int y);
void addEnemiesToLvl3();
void AddColliders();
void setCollidersToScenePos();
float GetCurrentCameraPixelPos();
void bossBackgroundFade();
public:
//bg textures------------------------------------
SDL_Texture* bgTexture = nullptr; //background
SDL_Texture* fgTexture = nullptr; //foreground(cave)
SDL_Texture* fgWavesTexture = nullptr;
SDL_Texture* bgWaterReflectionsTexture = nullptr;
SDL_Texture* bossBgTexture = nullptr;
SDL_Texture* wavesCapTexture = nullptr;
//SDL_Texture* submarineWavesTexture = nullptr;
//background needed rects
SDL_Rect bgRect;
SDL_Rect fgRect;
//background animations
Animation bgWaterReflectionsAnim[NUMREFLECTIONS];
Animation seaWavesAnim[MAXWAVES];
Animation wavesCapAnim;
// background logic variables ---------------------
bool scroll = false;
stage_zone currentLevelZone = stage_zone::level;
//float currenCameraPixelPos;
float currentCameraPixelPos;
// values for boss background fade ---
Uint32 start_time;
Uint32 total_time;
Uint32 now;
// -----------------------------------
bool faded = false;
// ------------------------------------------------
//set colliders scene correct speeds
Collider* sceneColliders[MAX_SCENE_COLLIDERS] = { nullptr };
int lastCameraPosX;
// debug colliders
Collider* debugColRight = nullptr;
Collider* debugColLeft = nullptr;
Collider* debugColCenter = nullptr;
Collider* debugColumn = nullptr;
};
#endif //! _MODULESCENELVL3_H__