Endless runner "problems"

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Criepstar

So, I’m trying to make an mobile endless runner. I already have the controls, but I only wanted to check how to make the game ,endless’'. So I thought, that I would build like five different parts of the map in a new scene and than randomly add them with level.add_child(scee_resource.instance()) and the set_pos(). I now use an Area2D object to delete and add new objects for the map is that the right way? Is that the right way to do it so or is there a more effiecent way.

-I wanted to ask too how can I make, that the parts of the map(I’m making a horizontal endless runner) all run at the same speed and the speed is getting every 5 seconds.

-And the last question, is there a function for the end/ when the game is closing so the game can save the highscore.
Thank you for your answers and I don’t know if the title has the right meaning!

Just some advice: it can be very difficult to predict how a certain implementation will perform, the only reliable way is to write it yourself and time it. Your idea of using an Area2D to control which scenes get instantiated makes sense to me, though.
Regarding your last question, no such function exists in the built-ins that Godot provides; you’d have to write it yourself (or find someone else’s implementation that is close to what you want on the Asset Library or Github/Gitlab).

DDoop | 2020-08-02 18:11

Thank you for your answer, I came up too with the idea that the game would save if you hit a object/when the round ends.

Criepstar | 2020-08-02 19:47