- fixed lives status to handle more than 5 lives
authorIngo Ruhnke <grumbel@gmx.de>
Mon, 26 Apr 2004 12:48:33 +0000 (12:48 +0000)
committerIngo Ruhnke <grumbel@gmx.de>
Mon, 26 Apr 2004 12:48:33 +0000 (12:48 +0000)
SVN-Revision: 741

src/gameloop.cpp

index cd98a86..8e8df1c 100644 (file)
@@ -121,7 +121,6 @@ GameSession::restart_level()
           world->get_tux()->base.y = best_reset_point.y;
         }
     }
-
     
   if (st_gl_mode != ST_GL_DEMO_GAME)
     {
@@ -674,7 +673,18 @@ GameSession::drawstatus()
   white_text->draw("COINS", screen->h, 0, 1);
   gold_text->draw(str, 608, 0, 1);
 
-  white_text->draw("LIVES", screen->h, 20, 1);
+  white_text->draw("LIVES", 480, 20);
+  if (player_status.lives >= 5)
+    {
+      sprintf(str, "%dx", player_status.lives);
+      gold_text->draw(str, 585, 20);
+      tux_life->draw(565+(18*3), 20);
+    }
+  else
+    {
+      for(int i= 0; i < player_status.lives; ++i)
+        tux_life->draw(565+(18*i),20);
+    }
 
   if(show_fps)
     {
@@ -682,11 +692,6 @@ GameSession::drawstatus()
       white_text->draw("FPS", screen->h, 40, 1);
       gold_text->draw(str, screen->h + 60, 40, 1);
     }
-
-  for(int i= 0; i < player_status.lives; ++i)
-    {
-      tux_life->draw(565+(18*i),20);
-    }
 }
 
 void