-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameEntity.h
53 lines (41 loc) · 1.07 KB
/
GameEntity.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
#ifndef _GAME_ENTITY_H_
#define _GAME_ENTITY_H_
#include "Point.h"
#include "ResourceCache.h"
#include <GL/glut.h>
class GameEntity
{
public:
GameEntity(const Point& location, const char* textureFileName, GLdouble size,
GLdouble textureAngleOffset)
: location(location), size(size), textureAngleOffset(textureAngleOffset)
{
dead = false;
textureID = ResourceCache::getTextureID(textureFileName);
}
virtual ~GameEntity()
{
/* nista u destruktoru */
};
bool isDead() const
{
return dead;
};
void setDead(bool dead)
{
this->dead = dead;
};
const Point& getLocation() const
{
return location;
}
virtual void draw() const = 0;
virtual void update() = 0;
protected:
Point location; // current location of entity
bool dead; // current state of entity
GLdouble size; // current size of entity
GLuint textureID; // entity's texture ID
GLdouble textureAngleOffset; // angle by which texture must be rotated to be in "normal" position
};
#endif /* _GAME_ENTITY_H_ */