-
Notifications
You must be signed in to change notification settings - Fork 0
/
entity.hpp
44 lines (32 loc) · 795 Bytes
/
entity.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
42
43
44
#ifndef _ENTITY_
#define _ENTITY_
#include <SFML/Graphics.hpp>
#include <Box2D/Box2D.h>
#include "texturemanager.hpp"
struct SCollidableBox {
b2Body* m_Body;
b2BodyDef m_BodyDef;
b2FixtureDef m_FixtureDef;
b2PolygonShape m_Shape;
void Create(float X, float Y, float SX, float SY, bool Solid);
};
class CEntity {
protected:
bool m_Solid;
SCollidableBox m_Box;
sf::Sprite m_Sprite;
sf::Vector2f m_Size;
sf::Vector2f m_Position;
sf::Clock m_Clock;
public:
bool IsSolid();
SCollidableBox& Box();
sf::Sprite& Sprite();
sf::Vector2f& Size();
sf::Vector2f& Position();
void Draw();
virtual void Update() {};
CEntity(float X, float Y, float SX, float SY, bool Solid = true);
virtual ~CEntity() {};
};
#endif