From 62ff7f7776875e9389d10ae2e7b6348e9e5cb9c7 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 1 Dec 2004 15:58:38 +0000 Subject: [PATCH] incorporated another patch from Ondra Hosek which fixes tux not getting killed on timeup, and adds sound to bomb again. Additionally fixed mrbomb not getting squishsound when jumped on and ticking bombs already killing enemies SVN-Revision: 2231 --- src/badguy/bomb.cpp | 5 ++++- src/badguy/mrbomb.cpp | 2 +- src/collision_grid.h | 2 ++ src/gameloop.cpp | 7 +++---- src/object/camera.cpp | 1 + 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/badguy/bomb.cpp b/src/badguy/bomb.cpp index c7445a278..66e834802 100644 --- a/src/badguy/bomb.cpp +++ b/src/badguy/bomb.cpp @@ -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; diff --git a/src/badguy/mrbomb.cpp b/src/badguy/mrbomb.cpp index bc9903d78..563cd6fdc 100644 --- a/src/badguy/mrbomb.cpp +++ b/src/badguy/mrbomb.cpp @@ -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; } diff --git a/src/collision_grid.h b/src/collision_grid.h index 09cc87afd..fe3f8314f 100644 --- a/src/collision_grid.h +++ b/src/collision_grid.h @@ -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. diff --git a/src/gameloop.cpp b/src/gameloop.cpp index c27bf6c19..de7c3b340 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -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 diff --git a/src/object/camera.cpp b/src/object/camera.cpp index ae9adf3cd..367030aa5 100644 --- a/src/object/camera.cpp +++ b/src/object/camera.cpp @@ -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"); -- 2.11.0