-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchar.hpp
More file actions
34 lines (31 loc) · 806 Bytes
/
char.hpp
File metadata and controls
34 lines (31 loc) · 806 Bytes
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
#ifndef CHAR_HPP
#define CHAR_HPP
class Char
{
private:
sf::Texture _texture;
sf::Sprite _spriteRunning[CHAR_FRAME_NUMBER];
sf::Sprite _spriteJumping[JUMPING_FRAME_NUMBER];
sf::SoundBuffer _buffer;
sf::Sound _stepSound;
int _currentFrame;
pos _pos;
int _speedY;
bool _isJumping;
sf::Time _elapsedTime;
sf::Time _animationElapsedTime;
public:
Char();
bool init(bool retry = false);
int getPosX();
int getPosY();
bool getIsJumping();
void setPosX(int X);
void setPosY(int Y);
void addPosX(int X);
void addPosY(int Y);
void jump();
void update(sf::Time elapsedTime);
void draw(sf::RenderWindow &window);
};
#endif