Looking for vertical scrolling

Hello Ardubrains,

I am working on a game, and need to scroll vertically. It is not a tile map, just lines on the screen using the draw functions, are there examples of vertical scrolling?

Thank you.


I should have explained better, the screen is 2:1 so that does indeed favor horizontal scrollers, and there are a few of them. My goal is a vertical game, and I am looking for clues that it’s practical. In the ancient days (when I’m from) 8-bit computer manuals explained all of the commands supported by that platform. The Sam Coupe for example, had scrolling commands in it’s BASIC that let you scroll by setting a flag. I realize it is not so easy on the Arduboy, but I could use a hint.

Thank you again.

Do you mean like this?

You can find documentation for the library here

See Classes->Arduboy2Core

There’s a few vertically scrolling games already one example is

1 Like

From what I gather vertical hardware scrolling is hard to control.

I completely forgot about Love Rush being vertically scrolled, that’s a pretty good example.

Hardware scrolling is possible but the issue is that the onscreen contents are scrolled but not the screen buffer in memory. This really only makes sense if you are writing directly to the screen without a buffer which presents many other problems. For example, the screen has scrolled 1 pixel down. Your player needs to be redrawn in the correct location but as it may have moved, you will need to redraw any scenery that is now revealed.

I slapped together a sideways scrolling routine here that scrolls the screen buffer. You could create a similar thing that scrolls vertically but the layout of the Arduboy’s screen memory makes it really CPU intensive as you need to bit shift each byte to move it a pixel at a time.

1 Like

If there was some overscan and better timing control then it might have been partially viable,
but then you’d still have to redraw your entities each time.

If I ever meet the person who decided that AVR chips shouldn’t have a barrel shifter…

Yes, I wonder if it was an oversight or there was a real reason?

Not 100% but you could also make the game using horizontal scrolling and rotate the screen like Adafruits SetRotation() I was going to do this with love rush to make it a Tate scroller for the purple card but never got round to it.

It would be a pretty big oversight.
Most likely it was for cost-cutting reasons, or to make the chips easier to manufacture.

On Arduboy it is custom redraw each display frame completely rather than to update part of the display buffer. You could just add a scroll offset to each y coordinate of your lines.