-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathPlayer.h
48 lines (31 loc) · 827 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
48
#pragma once
#include <SFML\Graphics.hpp>
#include <vector>
#define FRAME_ANIMATION 0 // 0 - hero animation
using namespace std;
using namespace sf;
class Player: public Drawable,Transformable
{
public:
Player();
~Player();
Player(float n_speed);
enum Status{ GO, STOP};
FloatRect getBoundingBox() { FloatRect f(sprite.getGlobalBounds()); return f; };
Vector2f getSpeed();
void update(Vector2f mousePos);
void stop();
void go();
Vector2f getPosition() { return sprite.getPosition(); };
Status getStatus() { return status; };
void setspeed(float n_speed) { speed = n_speed; };
float getspeed() { return speed; };
private:
Sprite sprite;
Texture texture;
Status status;
Clock anim_clock;
size_t frame;
float speed;
virtual void draw(RenderTarget &target, RenderStates states) const;
};