-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.h
90 lines (60 loc) · 1.58 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
78
79
80
81
82
83
84
85
86
87
88
89
90
#pragma once
#include "PlayerActions.h"
#include "GameObject.h"
#include "SceneGraph.h"
#include "Sound.h"
class Player : public GameObject
{
private:
glm::vec3 pos;
glm::vec3 vel;
Node *sceneGraphNode;
int hp, maxHP;
int sp, maxSP;
std::vector<CollisionBox> hitboxList;
//action list
Actions prevAction;
Actions currentAction;
Actions nextAction;
//actions
PlayerActions playerAction;
//-1 left, 1 right, 0 default
int isFacing;
//0 no, 1 yes
int onGround;
//1/framerate for the purposes of tracking time
float freq;
//action timer
int actionTimer;
//collision booleans TODO
//blast shield stun cooldown
int blastStunCooldown;
//temp timer to replace controller
int tempTimer;
//max distance between players
float maxDistBetweenPlayers;
//prevents multiple hits from one attack
int hasBeenHit;
int timeBeforeSPRegen;
public:
Player();
~Player();
void update(Player *otherPlayer, playerSFX &sfx);
void draw();
Actions controllerInput(Actions action);
void cycleActions();
std::vector<CollisionBox> GetCollisionBoxes(void);
inline int GetHP(void){ return hp; }
inline int GetSP(void){ return sp; }
inline int GetMaxHP(void) { return maxHP; }
inline int GetMaxSP(void) { return maxSP; }
glm::vec3 getPos();
void soundCheck(playerSFX &sfx);
//for affecting other player on blocking melee attack
void setNextAction(Actions newAction);
int getOnGround();
Actions getCurrentAction(){ return currentAction; }
int getFacing(){return isFacing;}
int getHit(){return hasBeenHit;}
void SetHealth(float healthValue){ hp = healthValue; }
};