How to make a parallax background

I know there is lots of information about this however they only seem to work with movement. I have a stationary camera and would like a background that constantly moves.

So you need to change it so that the various layer cameras move all the time, rather than just when the player moves. Say you have 3 layers for horizontal scrolling - fore_layer (that doesn’t move), mid_layer and back_layer. You could move them with an unconditional event :

image

1 Like

This works but is their away to make it repeat? like wrapping around the screen.

You can check the size of the moving background, when you reach the width/height, you can put it back to 0 to repeat.

Yeah, there are a few ways. The simplest is to use a tiled sprite as the background, and then change it’s offset. The sprite never moves, but it’s texture is redrawn at a slightly different position every frame.

The event action that does it all :

image


This is the image of the tiled sprite

Wall_plain

This is it lengthened and made taller :

image


And this is what it looks like :

TileSpriteScrolling

1 Like