3-layer Parallax Code for Side Scrolling Games

Published 2023-06-12



I made this bit of code for creating a parallax effect for side-scrolling games. It uses three layers of infinitely repeating maps. I've set it up so that all the code is in a self-contained section that can be copied and pasted below your own code, with just an initialise, update and draw function needing to be called from the respective functions in your game.

More complete instructions can be found in the header of the code.

I hope somebody finds it useful!

:)