Scrolling background

There are two background images in the res://assets/environment/layers folder: back.png and middle.png, for the far and near background, respectively. By placing these images behind the tilemap and scrolling them at different speeds relative to the camera, you can create an attractive illusion of depth in the background.

To start, add a ParallaxBackground node to the Level scene. This node works automatically along with the camera to create a scrolling effect. Drag this node to the top of the scene tree so that it will be drawn behind the rest of the nodes. Next, add a ParallaxLayer node as a child—ParallaxBackground can have any number of ParallaxLayer as children, allowing you to make many independently scrolling layers. ...

Get Godot Engine Game Development Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.