Skip to content

Create slightly-better than bare minimum parallax effect in Godot #10

@TSherpa10

Description

@TSherpa10

Background

With the normal parallax effect in Godot (parallaxLayer node) the background can shift from left to right. However, the level design will allow for the player to move up and down as well, so we need to write a script to make the background follow the player nicely. An extreme but great example of this is in Hollow Knight (link: https://www.youtube.com/watch?v=0QnLG-JEzzU&ab_channel=MonStahLer, here you can see when the Hollow Knight goes up and down the background loosely follows the player).

AC

  • Create basic parallaxLayer node (can use a dummy background picture for now until the background is complete).
  • Attach a script to this layer to interact with the Character2d node s.t. the background is seemless left-to-right and (if possible) allow it to loosely follow the player when going up and down.

If you want a (bad) example of this logic, here's the code to my old game doing this: https://github.com/TSherpa10/Brave-Summit/blob/main/scenes/background.gd
I think I want slight improvement to this logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions