-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMario.h
60 lines (47 loc) · 1.42 KB
/
Mario.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
/*!
* \file Mario.h
* \author Ekinox <[email protected]>
*/
#ifndef MARIO_INCLUDED
#define MARIO_INCLUDED 1
#include "AnimatedSprite.h"
#include "Map.h"
#include "Tile.h"
#include "ImageManager.h"
#include "config.h"
/*!
* \class Mario
* \brief This class models a Mario, the hero of Hypermario.
*/
class Mario : public AnimatedSprite
{
public:
private:
/*!
* \brief Is mario moving left, right, jumping, running or not ?
*/
bool myIsGoingLeft, myIsGoingRight, myIsJumping, myIsRunning;
float mySpeedY; //!< The speed of Mario on the Y axis
const Map *myMap; //!< The map in which Mario is evolving
float myReturnPosX, myReturnPosY; //!< Mario's return position
std::string mySize; //!< Mario's current size
sf::Uint16 myLifes; //!< Mario's number of lifes
bool myLost; //!< Has Mario lost the game ?
std::string myState; //!< The actual animation state of Mario
public:
Mario(const size_t PosX, const size_t PosY, const Map &map,
const sf::Uint16 Lifes);
void SetReturnPos(float X, float Y);
void Die();
bool Lost() const;
void GoRight();
void GoLeft();
void StopGoingLeft();
void StopGoingRight();
void Jump();
void Run();
void StopRunning();
void Update();
sf::View GetView() const;
};
#endif // MARIO_INCLUDED