Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23974/src
Modified Files:
world.cpp
Log Message:
- fixed small scrolling bug
- added screwed up backscroll to TODO
Index: world.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- world.cpp 4 May 2004 19:12:39 -0000 1.58
+++ world.cpp 4 May 2004 23:39:40 -0000 1.59
@@ -326,9 +326,9 @@
if(scrolling_timer.check())
{
float final_scroll_x;
- if (tux.dir == RIGHT)
+ if (tux.physic.get_velocity_x() > 0)
final_scroll_x = tux_pos_x - (screen->w - X_SPACE);
- else// if (tux.dir == LEFT)// && )
+ else if (tux.physic.get_velocity_x() < 0)
final_scroll_x = tux_pos_x - X_SPACE;
scroll_x += ((final_scroll_x - scroll_x) / (CHANGE_DIR_SCROLL_SPEED)) * frame_ratio;
@@ -336,9 +336,9 @@
else
{
- if (tux.dir == RIGHT && scroll_x < tux_pos_x - (screen->w - X_SPACE))
+ 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.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && (level->back_scrolling || debug_mode))
+ else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && (level->back_scrolling || debug_mode))
scroll_x = tux_pos_x - X_SPACE;
}
|