Re: [Super-tux-devel] Re: SuperTux - back scrolling
Brought to you by:
wkendrick
From: Ryan F. <rf...@gm...> - 2004-05-06 19:09:18
|
On Thu, 6 May 2004 13:03:45 +0100, Ricardo Cruz <ri...@ae...> wrote: > Anyway, I will clean it up a bit more, in order to turn it readable (I > haven't done it yet, since I am afraid of breaking anything). Well, your latest changes just broke my stuff :) I undid your changes and put it to the way I had it. You probably didn't notice my changes because they only work on levels with back_scroll set to true. I added a test level to CVS with back_scroll set to true. It's under the contrib. Regarding debug mode and and back_scroll: Right now if debug_mode is *NOT* enabled AND the level is *NOT* a backscroll level, then the old, working code is used. If the debug_mode *IS* enabled OR the level *IS* a backscroll level, then the new, buggy cold is used. If debug_mode *IS* enabled AND the level is *NOT* a backscroll level, the new buggy code is used, but there is no backscrolling in the level. This is to test to make sure that the new code still works on non-scrolling levels. Not sure if that made sense, but I hope it did :) I noticed that you set it so backscrolling is *always* used if debug_mode is enabled, but this way the code can't be tested on non-backsrolling levels. Be sure to try out my new code :) It's on it's way to working. The problem now is the (final_scroll_x - scroll_x) part. It makes the scroll start out fast and then slow down. The reason for this is because it always uses a certain percent of the *current* difference. Here's a (shitty) diagram: http://digitalhell.cjb.net/~ryan/supertux/scroll.png In this example 'X' is final_scroll_x and the lines are scroll_x. Each iteration scroll_x moves over 25% of the way. As you can see, there is a big jump at the beginning and then near the end 25% is very little, so it scrolls very slowly. I hope I explained this okay :) -- Ryan |