From 4efb3b8e3c83b38e7375604e83dd612be569d4a4 Mon Sep 17 00:00:00 2001 From: LMH Date: Wed, 10 Jul 2013 14:56:14 -1000 Subject: [PATCH] Climbing animation stops when Tux is not in motion --- src/object/player.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/object/player.cpp b/src/object/player.cpp index fbb89fa37..d1e42d8e4 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -435,6 +435,14 @@ Player::update(float elapsed_time) if (sprite->animation_done()) growing = false; } + // when climbing animate only while moving + if(climbing){ + if((physic.get_velocity_x()==0)&&(physic.get_velocity_y()==0)) + sprite->stop_animation(); + else + sprite->set_animation_loops(-1); + } + } bool -- 2.11.0