Applied patch from Matze Braun that was sent to the mailing list.
authorRicardo Cruz <rick2@aeiou.pt>
Tue, 27 Apr 2004 11:06:02 +0000 (11:06 +0000)
committerRicardo Cruz <rick2@aeiou.pt>
Tue, 27 Apr 2004 11:06:02 +0000 (11:06 +0000)
According to Matzes, changes are:

-fixes fast music being replayed again and again
-fixes time being displayed negatively when tux dies because of timeout
-fixes exploding bombs that hit mrbomb, so that the hit mrbomb now really
 transform into a bomb
-updates the TODO file


I've also fixed two more bugs listed in the TODO:

- enemies start running backwards, when they collide with a flame
- egg gets removed when leaving the screen, while badguys don't or at
  least much later, thus its not possible to wait for an egg that
  would bounce back


SVN-Revision: 774

src/badguy.cpp
src/gameloop.cpp
src/special.cpp

index 0388a75..63cb058 100644 (file)
@@ -1012,10 +1012,12 @@ BadGuy::collision(void *p_c_object, int c_object, CollisionType type)
       {
         if (pbad_c->kind == BAD_MRBOMB)
         {
-          // FIXME: this is where other MrBombs *should* explode istead of dying
-          pbad_c->kill_me(); 
+          // mrbomb transforms into a bomb now
+          World::current()->add_bad_guy(base.x, base.y, BAD_BOMB);
+          pbad_c->remove_me();
+          return;
         }
-        else if (pbad_c->kind != BAD_BOMB)
+        else if (pbad_c->kind != BAD_MRBOMB)
         {
           pbad_c->kill_me();
         }
@@ -1053,12 +1055,15 @@ BadGuy::collision(void *p_c_object, int c_object, CollisionType type)
         else if (base.y + base.height > pbad_c->base.y + pbad_c->base.height)
           break;
 
-        if (dir == LEFT)
-          dir = RIGHT;
-        else if (dir == RIGHT)
-          dir = LEFT;
-
-        physic.inverse_velocity_x();
+        if (pbad_c->kind != BAD_FLAME)
+          {
+          if (dir == LEFT)
+            dir = RIGHT;
+          else if (dir == RIGHT)
+            dir = LEFT;
+        
+          physic.inverse_velocity_x();
+          }
       }
       
       break;
index ad6b880..a51a5fa 100644 (file)
@@ -614,8 +614,7 @@ GameSession::run()
             world->play_music(HERRING_MUSIC);
         }
       /* are we low on time ? */
-      else if (time_left.get_left() < TIME_WARNING
-         && (world->get_music_type() == LEVEL_MUSIC))
+      else if (time_left.get_left() < TIME_WARNING)
         {
           world->play_music(HURRYUP_MUSIC);
         }
@@ -666,12 +665,13 @@ GameSession::drawstatus()
       white_text->draw("Press ESC To Return",0,20,1);
     }
 
-  if (time_left.get_left() > TIME_WARNING || (global_frame_counter % 10) < 5)
-    {
-      sprintf(str, "%d", time_left.get_left() / 1000 );
-      white_text->draw("TIME", 224, 0, 1);
-      gold_text->draw(str, 304, 0, 1);
-    }
+  if(!time_left.check()) {
+    white_text->draw("TIME'S UP", 224, 0, 1);
+  } else if (time_left.get_left() > TIME_WARNING || (global_frame_counter % 10) < 5) {
+    sprintf(str, "%d", time_left.get_left() / 1000 );
+    white_text->draw("TIME", 224, 0, 1);
+    gold_text->draw(str, 304, 0, 1);
+  }
 
   sprintf(str, "%d", player_status.distros);
   white_text->draw("COINS", screen->h, 0, 1);
index 7e4bcbe..a784744 100644 (file)
@@ -194,7 +194,7 @@ Upgrade::action(double frame_ratio)
   }
 
   /* Off screen? Kill it! */
-  if(base.x < scroll_x - base.width || base.y > screen->h) {
+  if((base.x < scroll_x - OFFSCREEN_DISTANCE) || base.y > screen->h) {
     remove_me();
     return;
   }