aboutsummaryrefslogtreecommitdiffstats
path: root/examples/shooter/player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/shooter/player.cpp')
-rw-r--r--examples/shooter/player.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/shooter/player.cpp b/examples/shooter/player.cpp
index b2b85cfd..dab743a9 100644
--- a/examples/shooter/player.cpp
+++ b/examples/shooter/player.cpp
@@ -10,7 +10,7 @@ void Player::setTexture(const yage::Texture &texture) {
texture_ = texture;
}
-void Player::draw(yage::SpriteBatch &sp) const
+void Player::draw(yage::SpriteBatch &sp)
{
static int time = 0;
static int iteration = 0;
@@ -21,7 +21,7 @@ void Player::draw(yage::SpriteBatch &sp) const
case Action::IDLE:
sp.draw(bound_,
{width, static_cast<int>(direction_) * height, width, height},
- texture_.id, yage::Colour(255, 255, 255, 255), 0);
+ texture_.id, yage::Colour(255, 255, 255, 255), 1);
break;
case Action::MOVING:
if(time % 15 == 0) {
@@ -29,7 +29,7 @@ void Player::draw(yage::SpriteBatch &sp) const
}
sp.draw(bound_,
{iteration * 2 * width, static_cast<int>(direction_) * height, width, height},
- texture_.id, yage::Colour(255, 255, 255, 255), 0);
+ texture_.id, yage::Colour(255, 255, 255, 255), 1);
time = (time + 1) % 59;
break;
}
@@ -61,6 +61,11 @@ void Player::idle()
action_ = Action::IDLE;
}
+void Player::look(Direction direction)
+{
+ direction_ = direction;
+}
+
glm::vec4 Player::position() const
{
return bound_;