Now the player dies when reaching the bottom of the level, even in Y-scrolling levels.
authorRicardo Cruz <rick2@aeiou.pt>
Tue, 18 May 2004 14:16:38 +0000 (14:16 +0000)
committerRicardo Cruz <rick2@aeiou.pt>
Tue, 18 May 2004 14:16:38 +0000 (14:16 +0000)
SVN-Revision: 1250

src/player.cpp
src/world.cpp

index 9d06c18..e0fd003 100644 (file)
@@ -796,7 +796,8 @@ Player::is_dying()
 
 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 00f3812..f0dbf04 100644 (file)
@@ -344,7 +344,7 @@ void World::scrolling(double frame_ratio)
 
   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);