From cb6ab50bb83e58a8cc99310fa88cc1855213f2fb Mon Sep 17 00:00:00 2001 From: Ryan Flegel Date: Tue, 25 May 2004 23:53:43 +0000 Subject: [PATCH] - added David's camera patch SVN-Revision: 1331 --- src/camera.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/camera.cpp b/src/camera.cpp index c25cc2050..41ffd9840 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -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 - 32 && 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 + 32) scrollchange = RIGHT; // calculate our scroll target depending on scroll mode @@ -220,10 +220,10 @@ Camera::scroll_normal(float elapsed_time) // that's the distance we would have to travel to reach target_x float delta_x = translation.x - target_x; // the speed we'd need to travel to reach target_x in this frame - float speed_x = delta_x / elapsed_time; + float speed_x = 1.3 * delta_x / elapsed_time; // limit our speed - float maxv = 1 + fabsf(player->physic.get_velocity_x() * 1.3); + float maxv = 1.3 * (1 + fabsf(player->physic.get_velocity_x() * 1.3)); if(speed_x > maxv) speed_x = maxv; else if(speed_x < -maxv) -- 2.11.0