Smooth vertical scrolling.

Post your CV coding questions here
Post Reply
User avatar
Milli
Site Admin
Posts: 224
Joined: Fri Jul 19, 2019 3:13 pm
Location: Beaver Falls PA
Contact:

Smooth vertical scrolling.

Post by Milli » 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 .
Milli

Cartermw
Posts: 17
Joined: Wed May 12, 2021 7:09 pm

Re: Smooth vertical scrolling.

Post by Cartermw » Thu Dec 30, 2021 4:09 pm

Thank you for sharing. I really hope to be coding in 2022.

User avatar
Wmaalouli
Posts: 155
Joined: Sat Jul 20, 2019 2:09 pm

Re: Smooth vertical scrolling.

Post by Wmaalouli » Fri Dec 31, 2021 5:43 pm

Great insight.
This is the kind of info that would not be preserved on the Facebook group. Now I know where to find it if I ever need it.

Post Reply