-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayerController.h
More file actions
85 lines (59 loc) · 1.39 KB
/
PlayerController.h
File metadata and controls
85 lines (59 loc) · 1.39 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
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
80
81
82
83
84
85
#ifndef PLAYERCONTROLLER_H
#define PLAYERCONTROLLER_H
#include "ControllerComponent.h"
#include "Event.h"
class PlayerController : public ControllerComponent {
public:
PlayerController();
~PlayerController();
void init(GameObject* spaceship);
private:
static const struct Bounds {
float x_max;
float x_min;
float y_max;
float y_min;
float z_max;
float z_min;
} BOUNDS;
enum Key {
UP,
RIGHT,
DOWN,
LEFT,
FIRE,
SLOW,
KEY_N
};
static const float LASER_INTERVAL;
static const int SHOTS_PER_PRESS = 2;
float m_fMovementSpeed;
float m_fYawVelocity;
float m_fPitchVelocity;
float m_fPitch; //radians
float m_fYaw; //radians
float m_fRoll; //factor
float m_fRollLimit; //radians
bool m_bJoypad;
bool m_bKeys[KEY_N];
unsigned int m_iLaserAudioID;
unsigned int m_iShotsToFire;
float m_fLaserTime;
float m_fCooldown;
GameObject* m_xSpaceship;
void activateLaser();
void fire();
void update(const Event& e);
void collisionHandler(const Event& e);
//void enterStateHandler(const Event& e);
//void leaveStateHandler(const Event& e);
void keyDownHandler(const Event& e);
void keyUpHandler(const Event& e);
void axisChangeHandler(const Event& e);
void buttonDownHandler(const Event& e);
void buttonUpHandler(const Event& e);
void joyConnectedHandler(const Event& e);
void joyDisconnectedHandler(const Event& e);
GameObject* m_xTestObj;
};
#endif