Climbing animation stops when Tux is not in motion
authorLMH <lmh.0013@gmail.com>
Thu, 11 Jul 2013 00:56:14 +0000 (14:56 -1000)
committerLMH <lmh.0013@gmail.com>
Thu, 11 Jul 2013 00:56:14 +0000 (14:56 -1000)
src/object/player.cpp

index fbb89fa..d1e42d8 100644 (file)
@@ -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