From b37e2da51e1bc021b2c9688c250b9f7af679f955 Mon Sep 17 00:00:00 2001 From: Ryan Flegel Date: Mon, 3 May 2004 19:46:23 +0000 Subject: [PATCH] - fixed scrolling bug SVN-Revision: 956 --- src/world.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/world.cpp b/src/world.cpp index 9e4b843cb..ad0cf6174 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -306,24 +306,24 @@ World::action(double frame_ratio) } // the space that it takes for the screen to start scrolling -#define X_SPACE 80 +#define X_SPACE 40 /* This functions takes cares of the scrolling */ void World::keep_in_bounds() { -int tux_pos_x = (int)(tux.base.x - (tux.base.width/2)); + int tux_pos_x = (int)(tux.base.x + (tux.base.width/2)); -scroll_x += screen->w/2; + scroll_x += screen->w/2; -if (scroll_x < tux_pos_x - X_SPACE) - scroll_x = tux_pos_x - X_SPACE; -else if (scroll_x > tux_pos_x + X_SPACE && level->back_scrolling) - scroll_x = tux_pos_x + X_SPACE; + if (scroll_x < tux_pos_x - X_SPACE) + scroll_x = tux_pos_x - X_SPACE; + else if (scroll_x > tux_pos_x + X_SPACE && level->back_scrolling) + scroll_x = tux_pos_x + X_SPACE; -scroll_x -= screen->w/2; + scroll_x -= screen->w/2; -if(scroll_x < 0) - scroll_x = 0; + if(scroll_x < 0) + scroll_x = 0; } -- 2.11.0