-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.h
47 lines (45 loc) · 1022 Bytes
/
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
#pragma once
#include <SFML/Graphics.hpp>
using namespace sf;
class Player {
private:
const float START_SPEED = 100;
const float START_HEALTH = 100;
Vector2f m_Position;
Sprite m_Sprite;
Texture m_Texture;
Vector2f m_Resolution;
IntRect m_Arena;
int m_TileSize;
bool m_UpPressed;
bool m_DownPressed;
bool m_LeftPressed;
bool m_RightPressed;
int m_Health;
int m_MaxHealth;
Time m_LastHit;
float m_Speed;
public:
Player();
void spawn(IntRect arena, Vector2f resolution, int tileSize);
void resetPlayerStatus();
bool hit(Time timeHit);
Time getLastHitTime();
FloatRect getPosition();
Vector2f getCenter();
float getRotation();
Sprite getSprite();
int getHealth();
void moveLeft();
void moveRight();
void moveUp();
void moveDown();
void stopLeft();
void stopRight();
void stopUp();
void stopDown();
void update(float elapsedTime, Vector2i mousePosition);
void upgradeSpeed();
void upgradeHealth();
void increaseHealthLevel(int amount);
};