From 2e121f31a99d92bca66dc851cd11510e475a8d0e Mon Sep 17 00:00:00 2001 From: Ryan Flegel Date: Tue, 4 May 2004 23:39:40 +0000 Subject: [PATCH] - fixed small scrolling bug - added screwed up backscroll to TODO SVN-Revision: 987 --- TODO | 5 ++--- src/world.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/TODO b/TODO index 3a7e6225d..67212cfbe 100644 --- a/TODO +++ b/TODO @@ -11,14 +11,13 @@ Todo H: high priority L: low priority -[H] Scrolling is broken, if you fastly reverse around the middle of the screen - the scrolling has sudden hickups. Also the scrollstart position still isn't - the same as before the changes. +[H] The scrollstart position still isn't the same as before the changes. [H] Frame ratio code has been changed and so the animation may need tuning. Somebody do some testing and change the definitions regarding this. [M] When aborting a level, lives and score should remain the same as they were before. Solution: make more dependency between the game engine and worldmap or just backup those variables before starting a level. +[L] Backscroll is really messed up right now :) [L] change lispreader to throw exceptions instead of simply assert() on syntax error [L] tux sometimes makes short jumps in the endsequence, mostly when diff --git a/src/world.cpp b/src/world.cpp index 68bc9259a..83fd424ac 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -326,9 +326,9 @@ void World::scrolling(double frame_ratio) if(scrolling_timer.check()) { float final_scroll_x; - if (tux.dir == RIGHT) + if (tux.physic.get_velocity_x() > 0) final_scroll_x = tux_pos_x - (screen->w - X_SPACE); - else// if (tux.dir == LEFT)// && ) + else if (tux.physic.get_velocity_x() < 0) final_scroll_x = tux_pos_x - X_SPACE; scroll_x += ((final_scroll_x - scroll_x) / (CHANGE_DIR_SCROLL_SPEED)) * frame_ratio; @@ -336,9 +336,9 @@ void World::scrolling(double frame_ratio) else { - if (tux.dir == RIGHT && scroll_x < tux_pos_x - (screen->w - X_SPACE)) + if (tux.physic.get_velocity_x() > 0 && scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && (level->back_scrolling || debug_mode)) + else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && (level->back_scrolling || debug_mode)) scroll_x = tux_pos_x - X_SPACE; } -- 2.11.0