Random gaps in a platformer must never be wider than the jump can cross
A generator that picks gap widths freely will sooner or later make one that cannot be crossed, especially when the far side is higher than the take-off point. The maximum depends on more than speed. Here is the full set of ingredients and a margin that keeps it fair.
Why this works
A jump is a short flight with a start, a peak and a landing, and how far it carries follows from how long the body stays up. A far side that is higher cuts that time, a lower one adds to it. Measure the real flight, then leave the player some slack.
When not to use it
Skip it when the jump can be steered in the air, boosted, or changed by items and double jumps. A single fixed reach is then wrong in both directions. Work out the widest crossing for the best case and the smallest for the plain case, and plan for both.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 30 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Random gaps in a platformer must never be wider than the jump can cross" (read_entry random-gap-width-from-jump-physics-and-landing-height) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP