From a9152a35ae53ccfa518160e66ff700cfd5f6d3be Mon Sep 17 00:00:00 2001 From: Ricardo Cruz Date: Tue, 27 Apr 2004 11:06:02 +0000 Subject: [PATCH] =?utf8?q?Applied=20patch=20from=20Matze=20Braun=20that=20?= =?utf8?q?was=20sent=20to=20the=20mailing=20list.=20According=20to=20Matze?= =?utf8?q?s,=20changes=20are:=20=EF=BF=BD=20-fixes=20fast=20music=20being?= =?utf8?q?=20replayed=20again=20and=20again=20-fixes=20time=20being=20disp?= =?utf8?q?layed=20negatively=20when=20tux=20dies=20because=20of=20timeout?= =?utf8?q?=20-fixes=20exploding=20bombs=20that=20hit=20mrbomb,=20so=20that?= =?utf8?q?=20the=20hit=20mrbomb=20now=20really=20=20transform=20into=20a?= =?utf8?q?=20bomb=20-updates=20the=20TODO=20file=20=EF=BF=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 23 ++++++++++++++--------- src/gameloop.cpp | 16 ++++++++-------- src/special.cpp | 2 +- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/badguy.cpp b/src/badguy.cpp index 0388a75ea..63cb0582c 100644 --- a/src/badguy.cpp +++ b/src/badguy.cpp @@ -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; diff --git a/src/gameloop.cpp b/src/gameloop.cpp index ad6b880a5..a51a5fa33 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -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); diff --git a/src/special.cpp b/src/special.cpp index 7e4bcbe6f..a784744bc 100644 --- a/src/special.cpp +++ b/src/special.cpp @@ -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; } -- 2.11.0