What is the correct way to implement 2D map moving


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.


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.

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

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.

1 Like