-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathEntity.hpp
More file actions
48 lines (39 loc) · 1.07 KB
/
Copy pathEntity.hpp
File metadata and controls
48 lines (39 loc) · 1.07 KB
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
#pragma once
#include "Utility/package.hpp"
//---------------------------------------------------------------------------------
// Written by Terence J. Grant - tjgrant [at] tatewake [dot] com
// Find the full tutorial at: http://gamedev.tutsplus.com/series/
//----------------------------------------------------------------------------------
class Entity
{
public:
enum Kind
{
kDontCare = 0,
kBullet,
kEnemy,
kBlackHole,
};
protected:
tTexture* mImage;
tColor4f mColor;
tPoint2f mPosition;
tVector2f mVelocity;
float mOrientation;
float mRadius;
bool mIsExpired;
Kind mKind;
public:
Entity();
virtual ~Entity();
tDimension2f getSize() const;
virtual void update() = 0;
virtual void draw(tSpriteBatch* spriteBatch);
tPoint2f getPosition() const;
tVector2f getVelocity() const;
void setVelocity(const tVector2f& nv);
float getRadius() const;
bool isExpired() const;
Kind getKind() const;
void setExpired();
};