From: Ricardo Cruz Date: Tue, 18 May 2004 14:16:38 +0000 (+0000) Subject: Now the player dies when reaching the bottom of the level, even in Y-scrolling levels. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=636db12f75b7130ec46d9be895c26eea1e1484ec;p=supertux.git Now the player dies when reaching the bottom of the level, even in Y-scrolling levels. SVN-Revision: 1250 --- diff --git a/src/player.cpp b/src/player.cpp index 9d06c188e..e0fd00397 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -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; diff --git a/src/world.cpp b/src/world.cpp index 00f381273..f0dbf04cb 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -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);