blob: 72af7c34cb23cc0e0a7c383da33d7cd53581b8f4 (
plain)
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
|
#ifndef EXAMPLE_SHOOTER_PLAYER_H
#define EXAMPLE_SHOOTER_PLAYER_H
#include "yage/yage.h"
enum class Direction {
LEFT,
DOWN,
RIGHT,
UP,
};
enum class Action {
IDLE,
MOVING,
};
class Player
{
public:
Player(const glm::vec4 &bound, const yage::Texture &texture);
void setTexture(const yage::Texture &texture);
void draw(yage::SpriteBatch &sp) const;
void move(Direction direction);
void idle();
private:
glm::vec4 bound_;
yage::Texture texture_;
Direction direction_;
Action action_;
int speed_;
};
#endif
|