Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6490/src
Modified Files:
player.cpp world.cpp
Log Message:
Now the player dies when reaching the bottom of the level, even in Y-scrolling levels.
Index: player.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- player.cpp 17 May 2004 17:05:22 -0000 1.100
+++ player.cpp 18 May 2004 14:16:37 -0000 1.101
@@ -796,7 +796,8 @@
bool Player::is_dead()
{
- if(base.y > World::current()->get_level()->height * /*TILE_HEIGHT*/ 32 || base.x < scroll_x - AUTOSCROLL_DEAD_INTERVAL) // last condition can happen in auto-scrolling
+ if(base.y > screen->h + scroll_y ||
+ base.x < scroll_x - AUTOSCROLL_DEAD_INTERVAL) // can happen in auto-scrolling
return true;
else
return false;
Index: world.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- world.cpp 17 May 2004 01:24:24 -0000 1.96
+++ world.cpp 18 May 2004 14:16:38 -0000 1.97
@@ -344,7 +344,7 @@
float tux_pos_y = tux.base.y + (tux.base.height/2);
- if(level->height > VISIBLE_TILES_Y-1)
+ if(level->height > VISIBLE_TILES_Y-1 && !tux.dying)
{
if (scroll_y < tux_pos_y - (screen->h - Y_SPACE))
scroll_y = tux_pos_y - (screen->h - Y_SPACE);
|