-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprojectile.h
More file actions
51 lines (41 loc) · 888 Bytes
/
projectile.h
File metadata and controls
51 lines (41 loc) · 888 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
49
50
51
#ifndef PROJECTILE_H
#define PROJECTILE_H
#include "entity.h"
#include "player.h"
typedef struct
{
int x;
int y;
int radius;
int damages;
int impact;
} explosion;
const IntRect listExp[] = {
IntRect(215, 56, 1, 1),
IntRect(66, 66, 30, 30),
IntRect(97, 66, 30, 30),
IntRect(129, 66, 30, 30),
IntRect(162, 66, 30, 30),
IntRect(193, 66, 30, 30),
IntRect(224, 66, 30, 30),
IntRect(258, 66, 30, 30)
};
class Projectile : public Entity
{
public:
Projectile(Pos start, Player::Weapon origin);
~Projectile();
bool mustRemove() const;
void draw();
void frame();
IntRect getRect() const;
Pos dir;
int speed;
Type getType() const{return Type_Projectile;}
enum Type {Explosive, Precision, NbType};
protected:
explosion exp;
void explode();
int explosion_step;
};
#endif // PROJECTILE_H