-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.h
45 lines (36 loc) · 856 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
#pragma once
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Network.hpp>
class Player
{
private:
//Shape
sf::RectangleShape shape;
//Variables
float movementSpeed;
int hpMax;
int hp;
float playerSize;
float outlineSize;
//Privare functions
void initVariables();
void initShape();
public:
//Constructors and Distructors
Player(float x = 0.f, float y = 0.f);
virtual ~Player();
//Accessors
const sf::RectangleShape& getShape() const;
const int& getHp() const;
const int& getHpMax() const;
//Functions
void takeDamage(const int damage);
void gainHealth(const int health);
void updateInput();
void updateWindowBoundsCollision(const sf::RenderTarget* target);
void update(const sf::RenderTarget* target);
void render(sf::RenderTarget* target);
};