Smooth vertical scrolling.
Posted: Thu Dec 30, 2021 7:12 am
In crazy climber redux I have very smooth one pixel vertical scrolling on the screen. The way I accomplish this is it relatively simple. It involves thinking ahead and doing most of your graphics prior to coding. In this case i created eight characters that are used to represent a window and a ledge. four across the top and four across the bottom. And then I would make a row based on those characters. That is one level of the building. I would continue this in my design until I had a whole building on the screen. Now to scroll it I had created all of those characters 16 different times. The reason I did 16 is that I have four characters on top four on bottom each character is eight pixels high so 16 are necessary for all 16 pixels. Each character is a one pixel variation of the previous character almost like frames in a movie. If you display one character then the other then the other you will get the effect of scrolling up or down and it would wrap. Now if every time you do a non-maskable interrupt 60 times a second you change the definition of those eight characters to the next frame that you previously designed you will get the effect of the building scrolling up or down the screen. It’s actually a very simple concept once you realize how it’s done. I use the same concept in Arkadion for the stars in the background but in this case instead of having multiple characters I now have a character that is 16 bytes long and I load the character definition as an offset into the 16 bytes and that causes the star to move up and down based on where it’s at in those 16 bytes .