-
Notifications
You must be signed in to change notification settings - Fork 1
/
ModulePowerUp.h
83 lines (58 loc) · 1.2 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
81
82
83
#ifndef __ModulePowerUp_H__
#define __ModulePowerUp_H__
#include "Module.h"
#include "Animation.h"
#include "Globals.h"
#include "p2Point.h"
#include "ModulePlayer.h"
#include "ModuleCollision.h"
#include "Path.h"
#define MAX_POWERUP 10
struct SDL_Rect;
struct SDL_Texture;
struct Mix_Chunk;
struct Collider;
enum COLLIDER_TYPE;
enum POWERUP_TYPE
{
_NONE,
TENTACLES_POWERUP,
BOMB_POWERUP,
SPEED_POWERUP,
ORB_POWERUP,
MISSILE_POWERUP,
};
struct PowerUp {
bool enabled;
Collider* collider = nullptr;
Animation anim;
iPoint position;
POWERUP_TYPE type = _NONE;
Path* path = new Path();
PowerUp();
PowerUp(const PowerUp& p);
~PowerUp();
void PU_Effect();
bool Update();
};
class ModulePowerUp : public Module
{
public:
ModulePowerUp();
~ModulePowerUp();
bool Start();
update_status Update();
bool CleanUp();
void OnCollision(Collider* c1, Collider* c2);
PowerUp* AddPowerUp(const PowerUp& powerup, int x, int y, COLLIDER_TYPE collider_type = COLLIDER_NONE);
public:
PowerUp bomb_powerup;
PowerUp tentacles_powerup;
PowerUp speed_powerup;
PowerUp YellowShells;
PowerUp Missile;
private:
SDL_Texture * graphics;
PowerUp * active[MAX_POWERUP];
};
#endif // __ModuleInput_H__