From: Ricardo Cruz Date: Tue, 27 Apr 2004 11:06:02 +0000 (+0000) Subject: Applied patch from Matze Braun that was sent to the mailing list. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a9152a35ae53ccfa518160e66ff700cfd5f6d3be;p=supertux.git Applied patch from Matze Braun that was sent to the mailing list. 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 --- 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; }