-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfighter.h
62 lines (41 loc) · 1 KB
/
fighter.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
#ifndef FIGHTER_H
#define FIGHTER_H
#include <glm/glm.hpp>
#include "animation.h"
struct box {
glm::vec2 position;
glm::vec2 dimensions;
box(glm::vec2 pos, glm::vec2 dim) : position(pos), dimensions(dim) {};
};
struct fighter {
float health = 100.0f;
//position
glm::vec2 position;
bool facingLeft = false;
box hitbox = box(glm::vec2(160.0f, 145.0f), glm::vec2(0.0f));
box hurtbox = box(glm::vec2(160.0f, 145.0f), glm::vec2(80.0f, 100.0f));
glm::vec2 velocity = glm::vec2(0.0f);
unsigned int af = 0;
animSequence* anim = nullptr;
bool shift = false;
bool isHit = false;
//combat states
bool attacking = false;
bool blocking = false;
bool parrying = false;
bool grabbing = false;
bool blockedATK = false;
unsigned int stopFrames = 0;
fighter(glm::vec2 position, bool facingleft);
void move(glm::vec2 vel);
void attack();
void block();
void blockedAttack();
void grab();
void bump();
void hit();
void draw(int flags);
void update();
void setAnim(animSequence* animS);
};
#endif