Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3620/src
Modified Files:
badguy.cpp gameloop.cpp special.cpp
Log Message:
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
»
Index: badguy.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- badguy.cpp 26 Apr 2004 19:58:11 -0000 1.52
+++ badguy.cpp 27 Apr 2004 11:06:02 -0000 1.53
@@ -1012,10 +1012,12 @@
{
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 @@
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: gameloop.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- gameloop.cpp 26 Apr 2004 19:58:11 -0000 1.111
+++ gameloop.cpp 27 Apr 2004 11:06:02 -0000 1.112
@@ -614,8 +614,7 @@
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 @@
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: special.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- special.cpp 26 Apr 2004 21:09:31 -0000 1.32
+++ special.cpp 27 Apr 2004 11:06:02 -0000 1.33
@@ -194,7 +194,7 @@
}
/* 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;
}
|