-
Notifications
You must be signed in to change notification settings - Fork 0
/
projectile.h
47 lines (37 loc) · 1.04 KB
/
projectile.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
#ifndef PORJECTILE__H
#define PORJECTILE__H
#include <string>
#include <vector>
#include "sprite.h"
class ExplodingSprite;
class Projectile : public Sprite{
public:
Projectile( const std::string& name);
Projectile( const std::string& name, const bool isRight);
Projectile(const Projectile& p);
virtual ~Projectile();
Projectile& operator=(const Projectile& rhs);
void draw() const;
void update(Uint32 ticks);
void explode();
bool getInUse() const { return inUse; }
void setInUse(const bool flag) { inUse = flag; }
bool getIsRight() const { return isRight; }
void setIsRight(const bool flag) { isRight = flag; }
int getDistanceCovered() const { return isRight; }
void setDistanceCovered(const int distance) {
distanceCovered = distance;
if(distanceCovered > lifeDistance){
inUse = false;
}
}
int getLifeDistance() const { return lifeDistance; }
private:
ExplodingSprite* explosion;
Sprite* explodeFrame;
bool inUse;
bool isRight;
int distanceCovered;
int lifeDistance;
};
#endif