incorporated another patch from Ondra Hosek which fixes tux not getting killed on...
authorMatthias Braun <matze@braunis.de>
Wed, 1 Dec 2004 15:58:38 +0000 (15:58 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 1 Dec 2004 15:58:38 +0000 (15:58 +0000)
SVN-Revision: 2231

src/badguy/bomb.cpp
src/badguy/mrbomb.cpp
src/collision_grid.h
src/gameloop.cpp
src/object/camera.cpp

index c7445a2..66e8348 100644 (file)
@@ -44,7 +44,8 @@ Bomb::collision_player(Player& player, const CollisionHit& )
 HitResponse
 Bomb::collision_badguy(BadGuy& badguy, const CollisionHit& )
 {
-  badguy.kill_fall();
+  if(state == 1)
+    badguy.kill_fall();
   return ABORT_MOVE;
 }
 
@@ -56,6 +57,8 @@ Bomb::active_action(float )
       if(timer.check()) {
         state = 1;
         sprite->set_action("explosion");
+        SoundManager::get()->play_sound(IDToSound(SND_EXPLODE), get_pos(),
+            Sector::current()->player->get_pos());
         timer.start(EXPLOSIONTIME);
       }
       break;
index bc9903d..563cd6f 100644 (file)
@@ -48,7 +48,7 @@ MrBomb::collision_squished(Player& player)
 {
   remove_me();
   Sector::current()->add_object(new Bomb(get_pos(), dir));
-  player.bounce(*this);
+  kill_squished(player);
   return true;
 }
 
index 09cc87a..fe3f831 100644 (file)
@@ -6,6 +6,8 @@
 
 using namespace SuperTux;
 
+class CollisionGridIterator;
+
 /**
  * A rectangular grid to keep track of all moving game objects. It allows fast
  * queries for all objects in a rectangular area.
index c27bf6c..de7c3b3 100644 (file)
@@ -765,12 +765,11 @@ GameSession::run()
     //frame_rate.update();
     
     /* Handle time: */
-    if (time_left.check() && currentsector->player->dying == DYING_NOT
-        && !end_sequence)
+    if (time_left.check() && !end_sequence)
       currentsector->player->kill(Player::KILL);
     
     /* Handle music: */
-    if(currentsector->player->invincible_timer.started() && !end_sequence)
+    if (currentsector->player->invincible_timer.started() && !end_sequence)
     {
       currentsector->play_music(HERRING_MUSIC);
     }
@@ -850,7 +849,7 @@ GameSession::drawstatus(DrawingContext& context)
           LEFT_ALLIGN, LAYER_FOREGROUND1);
     }
 
-  if(time_left.check()) {
+  if(time_left.get_timeleft() < 0) {
     context.draw_text(white_text, _("TIME's UP"), Vector(screen->w/2, 0),
         CENTER_ALLIGN, LAYER_FOREGROUND1);
   } else if (time_left.get_timeleft() > TIME_WARNING
index ae9adf3..367030a 100644 (file)
@@ -64,6 +64,7 @@ Camera::parse(const lisp::Lisp& reader)
     do_backscrolling = true;
     reader.get("backscrolling", do_backscrolling);
   } else if(modename == "autoscroll") {
+    printf("autoscroll.\n");
     mode = AUTOSCROLL;
     
     const lisp::Lisp* path_lisp = reader.get_lisp("path");