From: Ricardo Cruz Date: Tue, 4 May 2004 14:41:14 +0000 (+0000) Subject: Added a test for a end of level scrolling test... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=cd0d8af8570d281bd8843561aa631f7fe03ee359;p=supertux.git Added a test for a end of level scrolling test... There seems to be an end sequence issue regarding this, doesn't it make use of the scrolling()? SVN-Revision: 971 --- diff --git a/src/world.cpp b/src/world.cpp index 972f292e4..28c6a1b6d 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -347,8 +347,11 @@ void World::scrolling() scroll_x = tux_pos_x - X_SPACE; } + // this code prevent the screen to scroll before the start or after the level's end if(scroll_x < 0) scroll_x = 0; + if(scroll_x > (level->width-1) * 32) + scroll_x = (level->width-1) * 32; } void