Hey everyone,
I’m trying to figure out how to generate platforms so that they would be set out in a way like this:
Imagine a platformer where the player should be able to “run” and “jump” onto all of the platforms.
I’ve tried generating a random boolean every frame with a certain chance that it would be true, and if true, create a rectangle of random length (in a range of course), as the x-position increases across the map. This didn’t work because at times there were platforms really close together, and sometimes it would be impossible to get from one side of the map to another (platforms too far apart).
The
Could someone suggest an algorithm I could use? I need to know “when” and “where” to create a platform, and how to generate the positions and sizes.
Other info which may be relevant, I’m using Box2D, the player is a 2x2m box.
Thanks