Archive 17/01/2023.

What is the correct way to implement 2D map moving

Taymindis

Hi,

If I have a longer horizontal 2D map from start to the end. Should I moving the cameraNode or spriteNote? Or both?

For example the game:
Super Mario Run.

Thanks,

Modanung

For a simple (procedural) endless runner or flappy bird clone I’d use a static camera and horizontally locked player, with the world moving past.

In the example of Super Mario Run both the camera and the sprite would move, while the world remains static.

Taymindis

Thanks for your advice/
May I know which node is world regarding? Scene?

Modanung

Well, each object in the world would move by and disable or reposition itself once it has left the screen.

Have a look at the BarrierLogic of @1vanK’s Flappy Urho.