Dino World Run: Moving world

#Dino World Run #Godot

In a game, the player normally moves through the world. This works perfectly for the vast majority of games, but for endless runners this can lead to problems if the coordinates where the player is located encounter floating point errors. Admittedly, most players will probably never have a run that long before this becomes a problem, but the theoretical possibility of this alone interested me. How frustrating would it be if you had a mega run and then the game crashed or glitched?

To avoid this problem, I decided to move the entire world instead of the player in my game. In the video you can see in a zoomed out section of my game how the foreground and background move to create the parallax effect. The “ground” and the obstacles are again divided into their own segments, which are randomly selected and added by the game.

However, the fact that the world moves has a few consequences, for example it needs its own logic to move the world, which leads to problems with the physics engine, as the player does not move towards an object, but the object moves towards the player.

I don’t know if you know the game “The Outer Worlds”, there is a company with the slogan “It’s not the best choice. It’s Spacer’s choice”. It’s the same here, every decision has pros and cons. So it’s not necessarily the best choice, but at least it’s mine :)

Let me know if you have any question or want to see more details on how I implemented this.

If you made it this far into the blog post, why not give the game a try? ☺️ Dino World Run is now available for Android.