-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathObject.h
79 lines (50 loc) · 1.08 KB
/
Object.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef OBJECT_H
#define OBJECT_H
#include "inc.h"
enum SPACE { world = 0, screen = 1 };
enum Type {
tUndefined,
tPlayer,
tEnemy,
tObject,
tBullet,
tCamera
};
class Object {
private:
int id;
Type type;
Vector2d vel;
Vector2d pos;
float rotation;
bool onCam;
bool active;
Object* parent;
Texture* skin;
Rect* box;
public:
Object();
Object(float x, float y, Texture * textr, Type type);
Object(Vector2d vec, Texture * textr, Type type);
~Object();
void Pos(Vector2d pos);
Vector2d& Pos(SPACE space = world);
void Active(bool active);
bool Active();
void onCamera(bool onCamera);
bool onCamera();
void setParent(Object* parent);
Object* getParent();
void setSkin(Texture* texture, Type type);
Texture& getSkin();
Rect* getBox();
Type getType();
void setType(Type type);
void UpdateBox();
void Rotation(float r);
float Rotation(SPACE space);
void Update(Object * obj = nullptr);
virtual void Draw();
virtual void collisionDetected(Object * obj) = 0;
};
#endif