[Super-tux-commit] supertux/src world.cpp,1.62,1.63
Brought to you by:
wkendrick
From: Ryan F. <sik...@us...> - 2004-05-05 22:24:45
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2016 Modified Files: world.cpp Log Message: - fixed scrolling problem when starting from a reset point Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- world.cpp 5 May 2004 12:03:50 -0000 1.62 +++ world.cpp 5 May 2004 22:24:37 -0000 1.63 @@ -361,13 +361,21 @@ } else /*no debug*/ - { + { if (tux.physic.get_velocity_x() > 0 && scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) scroll_x = tux_pos_x - X_SPACE; + else + { + if (tux.dir == RIGHT && scroll_x < tux_pos_x - (screen->w - X_SPACE)) + scroll_x = tux_pos_x - (screen->w - X_SPACE); + else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && level->back_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; |