From 5c8bc800edb8be4dffc9e3a2a1f023a792362bdf Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Fri, 1 Aug 2014 23:39:13 +0200 Subject: [PATCH] Only rotate egg when its actually moving (velocity <> 0) --- src/object/growup.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/object/growup.cpp b/src/object/growup.cpp index 4f832b956..3ce08deca 100644 --- a/src/object/growup.cpp +++ b/src/object/growup.cpp @@ -46,9 +46,12 @@ GrowUp::update(float elapsed_time) } void -GrowUp::draw(DrawingContext& context){ - //Set Sprite rotation angle - sprite->set_angle(get_pos().x * 360.0f / (32.0f * M_PI)); +GrowUp::draw(DrawingContext& context) +{ + if(physic.get_velocity_x() != 0) { + //Set Sprite rotation angle + sprite->set_angle(get_pos().x * 360.0f / (32.0f * M_PI)); + } //Draw the Sprite. MovingSprite::draw(context); //Draw shade @@ -79,7 +82,7 @@ GrowUp::collision(GameObject& other, const CollisionHit& hit ) { Player* player = dynamic_cast(&other); if(player != 0) { - if(!player->add_bonus(GROWUP_BONUS, true)){ + if(!player->add_bonus(GROWUP_BONUS, true)) { // Tux can't grow right now. collision_solid( hit ); return ABORT_MOVE; -- 2.11.0