-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleParticles.h
More file actions
48 lines (38 loc) · 829 Bytes
/
ModuleParticles.h
File metadata and controls
48 lines (38 loc) · 829 Bytes
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
#pragma once
#include "Module.h"
#include "Animation.h"
#include "Globals.h"
#include "p2Point.h"
#include "p2List.h"
#include "ModuleCollision.h"
struct Particle
{
Animation anim;
unsigned int fx;
p2Point<int> position;
p2Point<int> speed;
Uint32 born;
Uint32 life;
bool fx_played;
Collider* collider;
Particle();
Particle(const Particle& p);
bool Update();
};
class ModuleParticles : public Module
{
public:
ModuleParticles(Application* app, bool start_enabled = true);
~ModuleParticles();
bool Start();
update_status Update();
bool CleanUp();
void OnCollision(Collider*, Collider*);
void AddParticle(const Particle& particle, int x, int y, COLLIDER_TYPE = COLLIDER_NONE, Uint32 delay = 0);
private:
SDL_Texture* graphics;
p2List<Particle*> active;
public:
Particle explosion;
Particle laser;
};