I Need Help Making A 2D Plat-former Endless Running Game

What I Need Help With Is Having A Random Generating Map For The Player To Run On

Any Ideas

You might want to ask @“JR 01” since he made a game like that called Drive. He might be able to help you.

Is it side scrolling?

Something like this perhaps?


Each floor sprite takes its X and Y. Adds a random amount (divisible by 32) to its X, then spawns another floor a random distance right of it.

Probably have a cutoff put in when the player stops moving, or it’ll go forever and crash maybe?

That’s the rawest form of the idea, sorry its a pretty limited example. Some things that could then be done with tinkering:

  • By adding a counter you could override the +x function. That way, it would spawn a platform 3 long, THEN choose a random distance to start the next 3 long platform. Going further from there, “3” is just an integer that could also be randomized. So then it’d spawn a platform “?” long, “?” blocks away from the current platform.

  • By using similar mechanics to this, you could then choose the Y of the next platform also, giving you different types of jump to make.

  • By using a random number selector and a bunch of logic gates, you could use it to spawn pre-defined “sections” of map or jump. Just need to make sure that each section is capable of joining up to any of the others.

Hope that helps!


Yes Thank You So much

I first tried that @Kollamma when I was making Drive, but its super inconsistent and even a pixel off would ruin the speed of the car. Let alone having it to spawn fast enough in front of the behavior.

@GrimProdutionZ, Its actually better to have the player to not move at all, it keep the player still and easy to see. Let the objects or terrain go to the player instead, this also makes the them easier to control.

You can check out more on Drive Nero:

@“JR 01” Is right - leaving the player stationary is a reasonable method. @Kollamma is also right - either approach can work, it just depends on how you want your game to work.

Here is an endless runner demo I’ve been tinkering with: https://flowlab.io/game/play/780150 - feel free to just grab the behaviors if they might help you.

I have a bundle that creates a single building “column”, and another “building” bundle that creates a series of those building columns to make a builder. Then I have some spawner logic that creates buildings near the player. Also, the building blocks destroy themselves once they get far enough away from the player.

yeah I know that it kind of is laggy when I tried @Kollamma’s. but I looked at yours and it looks pretty complicated

Yeah, mine is fairly complex, but that’s because it’s generating buildings on the fly. If you’re just adding single objects it can be much, much simpler.

hey grazer. I wanted to ask you about the save behavior. because I want my game to save high score I know its not related to the my discussion but I really don’t won’t to make a whole discussion for just one simple question

OK yeah I tried to use your mechanic on the one test but I can’t make it were it saves your highest score it only saves the one you got previously