-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModuleParticles.h
60 lines (45 loc) · 1.1 KB
/
ModuleParticles.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
#ifndef __MODULEPARTICLES_H__
#define __MODULEPARTICLES_H__
#include<list>
#include "Globals.h"
#include "Module.h"
#include "Animation.h"
#include "Point.h"
#include "ModuleCollision.h"
enum TypeParticle { WATER, DUST };
struct SDL_Texture;
struct Particle
{
// TODO 1: Fill in the structure with all the properties you need for each particle
bool to_delete = false;
iPoint position = { 0, 0 };
Animation anim;
float speed = 0.f;
int timeToDelete = 0;
TypeParticle typeParticle;
Particle();
Particle(const Particle& p);
~Particle();
void Update();
};
class ModuleParticles : public Module
{
public:
ModuleParticles();
~ModuleParticles();
bool Start();
update_status PreUpdate(); // clear dirty particles
update_status Update(); // draw
bool CleanUp();
void AddWaterParticle(const Particle& particle, int x, int y);
void AddDustParticle(const Particle& particle, int x, int y);
private:
SDL_Texture* graphics = nullptr;
std::list<Particle*> active;
public:
// prototype particles go here ...
Particle* water;
Particle* dust;
unsigned int fxDust;
};
#endif // __MODULEPARTICLES_H__