Small fix. Don't do back scrolling, in case it is unabled.
authorRicardo Cruz <rick2@aeiou.pt>
Mon, 24 May 2004 21:52:14 +0000 (21:52 +0000)
committerRicardo Cruz <rick2@aeiou.pt>
Mon, 24 May 2004 21:52:14 +0000 (21:52 +0000)
And don't do vertical scrolling when there are 19 height tiles. It is necessary to explecity say so cause in this case, the actual height of the level is 608, higher than the screen (600).

SVN-Revision: 1314

src/camera.cpp

index 1db1c9d..2c145da 100644 (file)
@@ -82,7 +82,7 @@ Camera::scroll_normal(float elapsed_time)
 
   bool do_y_scrolling = true;
 
-  if(player->dying)
+  if(player->dying || level->height == 19)
     do_y_scrolling = false;
 
   if(do_y_scrolling) {
@@ -115,7 +115,7 @@ Camera::scroll_normal(float elapsed_time)
   if((player->dir == ::LEFT && scrollchange == RIGHT)
       || (player->dir == ::RIGHT && scrollchange == LEFT))
     scrollchange = NONE;
-  if(player->base.x < translation.x + screen->w/3)
+  if(player->base.x < translation.x + screen->w/3 && level->back_scrolling)
     scrollchange = LEFT;
   else if(player->base.x > translation.x + screen->w/3*2)
     scrollchange = RIGHT;