-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHero.h
More file actions
40 lines (34 loc) · 1.15 KB
/
Hero.h
File metadata and controls
40 lines (34 loc) · 1.15 KB
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
#pragma once
#include "Header.h"
#include <SFML/Graphics.hpp>
#include "Object.h"
class Hero : public Object
{
public:
Hero(sf::String ImageFile, sf::String ImageFileAttack, int maxFrameX, int maxFrameY, double x, double y, const UtilitiesGame::Stats& stats);
~Hero();
private:
float currentFrameAttackX{ 0 }; float currentFrameAttackY{ 0 };
bool temp{ false };
int numberTield{ 1 };
double speedOneFrame;
bool healthChange;
virtual int actionCollisionObjects(Object* obj) override;
float attackTime;
protected:
UtilitiesGame::Stats stats;
bool deathResolution{ true };
public:
double getSpeed();
// Óíàñëåäîâàíî ÷åðåç Object
virtual bool animation(int direction) override;
virtual int update(sf::Event) override;
void resetAnimationAttack();
const UtilitiesGame::Stats& getStats() { return stats; };
void setMaxHealthPoints(const int maxHP) { this->stats.maxHealthPoints = maxHP; };
void setHealthPoints(const int hp) { this->stats.healthPoints = hp; };
const int getHealthPoints() { return stats.healthPoints; };
const int getMaxHealthPoints() { return stats.maxHealthPoints; };
void changeHealthPoints(int addHP);
void setHealthChange(bool ok);
};