-
Notifications
You must be signed in to change notification settings - Fork 1
/
Player.h
57 lines (47 loc) · 1.12 KB
/
Player.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
#ifndef _PLAYER_H_
#define _PLAYER_H_
#include <string>
#include "Vector.h"
#include "BBox.h"
#include "Timer.h"
namespace typing
{
class Player
{
public:
static void Init();
void Reset(unsigned int lives);
void Draw();
void Update();
void Fire();
void Damage();
const juzutil::Vector3& GetOrigin() const
{
return PLAYER_ORIGIN;
}
const BBox GetBounds() const
{
return PLAYER_BOUNDS + PLAYER_ORIGIN;
}
unsigned int Lives() const
{
return m_lives;
}
void ExtraLife()
{
m_lives++;
}
private:
// Consts/Enums
static const float FIRE_FADE_TIME;
static const float DAMAGE_FADE_TIME;
static const float PLAYER_SIDE;
static const juzutil::Vector3 PLAYER_ORIGIN;
static const BBox PLAYER_BOUNDS;
// Members
unsigned int m_lives;
float m_lastFireTime;
float m_damageTime;
};
}
#endif // _PLAYER_H_