Added a test for a end of level scrolling test...
authorRicardo Cruz <rick2@aeiou.pt>
Tue, 4 May 2004 14:41:14 +0000 (14:41 +0000)
committerRicardo Cruz <rick2@aeiou.pt>
Tue, 4 May 2004 14:41:14 +0000 (14:41 +0000)
There seems to be an end sequence issue regarding this, doesn't it make use of the scrolling()?

SVN-Revision: 971

src/world.cpp

index 972f292..28c6a1b 100644 (file)
@@ -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