diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-12-31 18:00:01 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-12-31 18:00:01 +0000 |
commit | 34908f108ad7c2ee6cff96491a0bc40381477424 (patch) | |
tree | f58c6bdde485d07a7136f78055240bab923bd4a6 /examples/shooter/player.h | |
parent | 943e3a5bc98ebcc2aa1b1d576700f7c4010c143c (diff) | |
download | YAGE-34908f108ad7c2ee6cff96491a0bc40381477424.tar.gz YAGE-34908f108ad7c2ee6cff96491a0bc40381477424.zip |
[Test] Benchmarking the engine and trying to optimize.
Diffstat (limited to 'examples/shooter/player.h')
-rw-r--r-- | examples/shooter/player.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/examples/shooter/player.h b/examples/shooter/player.h new file mode 100644 index 00000000..72af7c34 --- /dev/null +++ b/examples/shooter/player.h @@ -0,0 +1,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 |