-
Notifications
You must be signed in to change notification settings - Fork 1
/
Player.h
77 lines (64 loc) · 1.54 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#pragma once
#include "GameObject.h"
#include "Hook.h"
#include "Chain.h"
#include "HealthBar.h"
#include <string>
class Hook;
class Chain;
class HealthBar;
class Player : public GameObject {
public:
int playerNumber;
PointLight* sight;
PointLight* hookSight;
PointLight* canonSight;
Hook* hook;
Chain* chain;
bool pulling;
float health;
glm::vec3 hookpoint;
bool fire = false;
bool grapple = false;
HealthBar* healthBar;
Player();
Player(int number);
void pull();
void hit();
bool isHit();
virtual void update();
private:
double lastHookTime;
double lastHitTime;
double lastGrappleTime;
void die();
};
class KeyboardPlayer : public Player {
public:
KeyboardPlayer(int number) : Player(number) {
}
virtual void update();
private:
float rotation;
};
class JoystickPlayer : public Player {
public:
const float* joystickAxis;
int joystickAxisCount;
const unsigned char* joystickButtons;
int joystickButtonsCount;
std::string CONTROLER_NAME;
JoystickPlayer(int number) : Player(number) {}
void calibrate();
virtual void update();
private:
glm::vec3 joystickCalibration[2];
};
class Rotor : public GameObject {
public:
Rotor(Player* owner, float rotation, float height);
virtual void update();
private:
Player* player;
float rot;
};