-
Notifications
You must be signed in to change notification settings - Fork 0
/
Projectile.hpp
42 lines (34 loc) · 911 Bytes
/
Projectile.hpp
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
/*
* File: Projectile.hpp
* Author: iMer
*
* Created on 24. August 2014, 13:36
*/
#ifndef PROJECTILE_HPP
#define PROJECTILE_HPP
#include "SpriteNode.hpp"
#include "util/Event.hpp"
class Projectile;
class ProjectileContactListener : public engine::util::EventHandler<b2Contact*, bool> {
protected:
Projectile* m_projectile;
public:
ProjectileContactListener(Projectile* p);
virtual void handle(b2Contact* c, bool begin);
};
class Projectile : public engine::SpriteNode {
protected:
ProjectileContactListener m_contactListener;
bool m_killed;
bool m_autoDestroy;
bool m_harmEnemies;
public:
Projectile(engine::Scene*);
virtual ~Projectile();
virtual void OnUpdate(sf::Time interval);
void Kill();
virtual bool initialize(Json::Value& root);
void SetHarmEnemies(bool harmEnemies);
bool IsHarmEnemies() const;
};
#endif /* PROJECTILE_HPP */