|File Name: ||Multi-step Autoscroll |
|Submitted: ||2016-12-31 07:15:04 AM by Mathos |
|Authors: ||Mathos |
|Type: || |
|Includes GFX: ||No |
|Includes Hijack: ||No |
|Featured: ||No |
|Description: ||This code allows you to create your own special autoscroll that goes where you want at the speed you want, much like the generator used in Butter Bridge 1 (level 00C) in the original game. |
It works by using tables where you store X/Y speeds for each step of the autoscroll. It allows, notably, the use of speeds inferior to 1 pixel/second via frame check, and it can be paused/resumed anytime you want using a flag. Plus, all the free RAM used can be easily changed to avoid conflicts.
Details in .asm file.
While this is a super cool code, I cannot accept it for one reason. If you run into the side of the screen while it is scrolling, you die. This creates a difference between this and the normal auto scroll sprites, which cause the side of the screen to act like a wall. Fix that issue, and I would happily accept this code.
Additionally, it might be better to use fractional speeds, instead of applying the speed once every N frames. It's quite unlikely that someone will need the screen to move 7FF pixels in one frame, so dividing by 10 (or even 100) can give the user more fine control without sacrificing too much. You could even make the fraction configurable, then you would lose nothing.
Also: Feature request, it could be a good idea to allow the code to loop instead of stopping. Just a define would be fine, but that way, you could scroll forever, say in a weird room that you don't necessarily need to run through linearly.