I’m making an endless runner game. For the game to progress endless, objects are spawned off the game screen and begin to move. I used as “schedule” to get spawn times regular, but as the picture shows, the distance between the objects is different because the spawn times change somehow. What am I missing?
Generally, you would use position based calculations, not time based.
ie: keep a variable of how far the character has moved, then, if position > nextSeed, add new object(s) with position based calculations from the global origin.
Also, if you start to make it more complex, you can create a tilemap, and then spawn tileLayers as objects instead of individual sprite objects.
As far as i know the frame rate has variations and the call to that schedule can have variations in time too, that is why the float dt is there to know how long took before the last call. So maybe those difference in time are the difference in distance between buildings. I think you should try the @tdebock aproach.