forked from CircusGames/Last_Resort
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModulePowerUp.h
80 lines (60 loc) · 1.34 KB
/
ModulePowerUp.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
#ifndef __MODULEPOWERUP_H__
#define __MODULEPOWERUP_H__
#include "Module.h"
#include "Globals.h"
#include "ModuleEnemies.h"
//#include "ModuleCollision.h"
#include "Animation.h"
//#include "ModulePlayerUnit.h"
#include "ModuleCollision.h"
#define MAX_ACTIVE_POWERUPS 10
#define MAX_TYPES 6
struct SDL_Texture;
enum powerUpColor
{
BLUE,
ORANGE
};
struct PowerUp
{
Collider* collider = nullptr;
Animation anim;
SDL_Texture* texture = nullptr;
char* fx = nullptr;
iPoint position;
iPoint speed;
powerUpTypes type;
powerUpColor color;
bool fx_played = false;
fPoint fspeed; //if we want the powerup movement more slowly/faster than camera/player scroll/mov
PowerUp();
//PowerUp(const PowerUp& p);
~PowerUp();
bool Update();
};
class ModulePowerUp : public Module
{
public:
ModulePowerUp();
~ModulePowerUp();
bool Start();
update_status Update();
bool CleanUp();
public:
PowerUp * active_powerUps[MAX_ACTIVE_POWERUPS] = {nullptr};
SDL_Texture * powerUpUnit = nullptr;
SDL_Texture* powerUpTextures = nullptr;
void SpawnPowerUp(iPoint position, powerUpTypes type);
void OnCollision(Collider* c1, Collider* c2);
public:
SDL_Rect testRect;
//SDL_Rect powerUpS;
//SDL_Rect powerUpZ;
PowerUp powerUpS;
PowerUp powerUpZ;
PowerUp powerUpH;
PowerUp powerUpG;
PowerUp powerUpL;
powerUpColor color;
};
#endif // !__MODULEPOWERUP_H__