• General Chat
  • Parallax background combined with static background

I'm looking to add a parallax background (clouds) on top of a fixed background (sky) in a match 3 game. The camera is fixed and does not move around the level. This is the layout I have in mind:

Control -- Camera2D -- Sprite (sky) -- ParallaxBackground ---- ParallaxLayer ------ Sprite (cloud) ---- ParallaxLayer ------ Sprite (cloud)

For a fixed camera game like a match 3 does it make more sense to not use a parallax background and simply animate the clouds in code? That layout would look like:

Control -- Camera2D -- Sprite (sky) -- Sprite (cloud, animated in code) -- Sprite (cloud, animated in code)

All of the parallax background tutorials that I have found are for games where the player is moving in the level and the camera follows them. Is a moving camera a requirement for a parallax background?

Welcome to the forum @highlander!

If the camera isn't moving, I would just have the clouds be animated either though code or though an AnimationPlayer node, as then you also have the benefit of being able to change it easily later. I've done a few animated backgrounds for casual games and I just used an AnimationPlayer with a 20-50 second long animation with a few key frames to move elements around. If you want it semi-dynamic, another good option might be using Tween nodes.

I haven't used a ParallaxBackground or ParallaxLayer, but from what I have found on Reddit, it may be possible to set the scroll property to move the background.