Fixes dying animation issue where it is stuck at frame 0.
authorRyan Flegel <rflegel@gmail.com>
Mon, 16 Jun 2008 04:01:21 +0000 (04:01 +0000)
committerRyan Flegel <rflegel@gmail.com>
Mon, 16 Jun 2008 04:01:21 +0000 (04:01 +0000)
SVN-Revision: 5576

src/object/player.cpp

index 63770ef..085ca7d 100644 (file)
@@ -943,7 +943,10 @@ Player::draw(DrawingContext& context)
     sa_prefix = "small";
 
   /* Set Tux sprite action */
-  if (growing) {
+  if(dying) {
+    sprite->set_action("gameover");
+  }
+  else if (growing) {
     sprite->set_action_continued((dir == LEFT)?"grow-left":"grow-right");
     // while growing, do not change action
     // do_duck() will take care of cancelling growing manually
@@ -994,10 +997,6 @@ Player::draw(DrawingContext& context)
   }
 */
 
-  if(dying) {
-    sprite->set_action("gameover");
-  }
-
   /* Draw Tux */
   if (safe_timer.started() && size_t(game_time*40)%2)
     ;  // don't draw Tux