diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2018-01-06 11:30:24 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2018-01-06 11:30:24 +0000 |
commit | c7090180503f263c60ec34844992e0e8d4bea85a (patch) | |
tree | 6ecc5b2e16856db49de056738b36e1ba103d3049 /examples/shooter/player.h | |
parent | cf4c73f2a75b470a4d4c4167105f92bc46f1926c (diff) | |
parent | 07012cf0982d3f86aebe83b5bdc4a67332c635da (diff) | |
download | YAGE-c7090180503f263c60ec34844992e0e8d4bea85a.tar.gz YAGE-c7090180503f263c60ec34844992e0e8d4bea85a.zip |
Merge branch 'develop'
Diffstat (limited to 'examples/shooter/player.h')
-rw-r--r-- | examples/shooter/player.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/examples/shooter/player.h b/examples/shooter/player.h new file mode 100644 index 00000000..8b5121c5 --- /dev/null +++ b/examples/shooter/player.h @@ -0,0 +1,36 @@ +#ifndef EXAMPLE_SHOOTER_PLAYER_H +#define EXAMPLE_SHOOTER_PLAYER_H + +#include <yage/yage.h> + +#include "direction.h" + +enum class Action { + IDLE, + MOVING, +}; + +class Player : public yage::Drawable +{ +public: + Player(const glm::vec4 &bound, const yage::Texture &texture); + + void setTexture(const yage::Texture &texture); + + void draw(yage::SpriteBatch &sp); + + void move(Direction direction); + void idle(); + void look(Direction direction); + + // simple getters + glm::vec4 position() const; +private: + glm::vec4 bound_; + yage::Texture texture_; + Direction direction_; + Action action_; + int speed_; +}; + +#endif |