-
Notifications
You must be signed in to change notification settings - Fork 0
/
Character.h
75 lines (59 loc) · 1.25 KB
/
Character.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
#pragma once
#include <SFML/Graphics.hpp>
#include "TextureManager.h"
class Character : public sf::Sprite {
//Combat Stats
float maxHp;
float curHp;
float damage;
float ms;
float atkSpd;
sf::Vector2f curVelocity;
//Position
float curX;
float curY;
float angle;
//Flags
bool alive;
bool moving;
bool invincible;
bool hidden;
//Take Damage
bool isInvincible();
int invulnTime;
int counter;
public:
//Constructors
Character();
//Getter Functions
float getCurHp();
float getMaxHp();
float getDamage();
float getMs();
float getAtkSpd();
float getCurX();
float getCurY();
float getAngle();
sf::Vector2f getCurVelocity();
int getCounter();
bool isHidden();
//Setters
void setHidden(bool x);
void setMs(float x);
void setDamage(float x);
//Counter
void incrementCounter();
void resetCounter();
//HP Functions
void takeDamage(int dmgTaken);
void heal(int healthGain);
//Position Functions
void updatePosition(float x, float y);
void updateAngle(float x);
void pointMouseCursor(sf::RenderWindow& win);
void moveTowardMouse(sf::RenderWindow& win);
void moveToPos(sf::Vector2f pos);
void moveToPos(float x, float y);
//End Game Functions
void death();
};