Added the 16 margin to the camera move checking as suggested by Ryan.
authorRicardo Cruz <rick2@aeiou.pt>
Fri, 28 May 2004 23:09:37 +0000 (23:09 +0000)
committerRicardo Cruz <rick2@aeiou.pt>
Fri, 28 May 2004 23:09:37 +0000 (23:09 +0000)
I still prefer no value, but at least it is not as bad as 32.

SVN-Revision: 1358

src/camera.cpp

index bef202d..3fdf3ac 100644 (file)
@@ -202,10 +202,10 @@ Camera::scroll_normal(float elapsed_time)
       || (player->dir == ::RIGHT && scrollchange == LEFT))
     scrollchange = NONE;
   // when in left 1/3rd of screen scroll left
-  if(player->base.x < translation.x + screen->w/3 && do_backscrolling)
+  if(player->base.x < translation.x + screen->w/3 - 16 && do_backscrolling)
     scrollchange = LEFT;
   // scroll right when in right 1/3rd of screen
-  else if(player->base.x > translation.x + screen->w/3*2)
+  else if(player->base.x > translation.x + screen->w/3*2 + 16)
     scrollchange = RIGHT;
 
   // calculate our scroll target depending on scroll mode