From 5427f85c0a92e668182a2d4f028dbd4fd4b95e52 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Sun, 12 Jul 2020 22:42:10 -0500 Subject: [PATCH] Update animation example --- examples/animation/src/main.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/examples/animation/src/main.cpp b/examples/animation/src/main.cpp index 2aaeea8..6e70d1d 100644 --- a/examples/animation/src/main.cpp +++ b/examples/animation/src/main.cpp @@ -24,7 +24,7 @@ private: sf::Vector2u window_size; public: - explicit PlayerEntity(sf::Vector2u window_size) : window_size(window_size) { + explicit PlayerEntity(sf::Vector2u window_size) : Entity(sprite), window_size(window_size) { texture.loadFromFile("player_sheet.png"); texture.setSmooth(true); sprite.setTexture(texture); @@ -39,8 +39,8 @@ public: AddComponent(std::move(move_anim_component)); AddComponent(std::make_unique(*this, sprite, - 0, 0, - sprite.getGlobalBounds().width, sprite.getGlobalBounds().height)); + 20, 12, + sprite.getGlobalBounds().width - 40, sprite.getGlobalBounds().height - 15)); } ~PlayerEntity() override { @@ -49,18 +49,6 @@ public: simpleengine::Entity::~Entity(); } - void Move(const float& delta_time, const float& x, const float& y) override { - sprite.move(x, y); - } - - void Move(const float& delta_time, const sf::Vector2f& offset) override { - sprite.move(offset * delta_time); - } - - void Move(const sf::Vector2f& offset) override { - sprite.move(offset); - } - void Update(const float& delta_time) override { Entity::Update(delta_time); }