How to Make a Platformer With AI, Starting With the Jump
A platformer is a jump first and a game second, so ask your AI for one jump on one screen and tune it before anything else. Your levels are then built from how far and how high that jump really reaches.
Why can a jump work and still feel wrong?
Your AI can make a character leave the ground in seconds. What it cannot do is feel your thumb.
Picture a small chimney sweep running over rooftops at dusk, chasing lost kites. The player presses jump a moment after leaving the roof edge, and nothing happens. The code did exactly what it was told. The player still says the game is broken.
That gap between correct and fair is the hard part of this genre. Three small tricks close most of it:
- Coyote time still allows a jump for a split second after leaving a ledge. Start near 0.09 seconds.
- Jump buffering remembers a press made just before landing. Start near 0.12 seconds.
- Variable jump height turns a tap into a hop and a long press into a full jump.
What is the smallest version worth building?
One screen and no art. A grey square, a floor, two platforms and one gap that can only just be cleared. For the sweep, that is two rooftops with a chimney between them.
If crossing that gap twenty times in a row is still pleasant, you have a game. If it is dull, scenery will not rescue it.
What comes next, step by step?
- Running, with a quick start and a quick stop.
- The jump, then coyote time, buffering and variable height.
- A short note that records how many squares the jump clears across and up.
- One danger, such as a roof tile that slides away, plus a fast restart after a fall.
- One short level, built only from the distances in your note.
- Extra moves like a double jump, and only when a level asks for one.
Step 3 looks boring, and it is the one that saves the project.
What kills platformer projects?
Changing the jump after the levels exist. Every gap, ledge and ceiling in your game is a silent promise about how far the character can reach.
Say you have twelve rooftop levels, and you raise the jump a little because it feels nicer. Now players skip half of each level and bump their heads on the ceilings in the rest.
So settle the jump before you build level two. If you must change it later, plan to replay every level.
Paste this to your AI
I want to make a 2D platformer. Before any game code, draw the character's loop as a state machine in a Mermaid diagram: standing, running, rising, falling, landing. Walk every arrow, show me any key press that has nowhere to go, and build from that diagram.
Build only this for now: one screen, a grey square I control, a floor, two platforms, and one gap that can just barely be cleared. Arrow keys and space.
Add coyote time (about 0.09 seconds), jump buffering (about 0.12 seconds) and a jump that goes higher the longer I hold the button. Keep every movement number in one place. Then tell me how many squares the jump clears sideways and upwards.
Do not tell me the jump works because the code looks right. Tell me exactly what you tried, on which platform, and what happened. If you could not run it, say you do not know yet. How it feels is my call.
Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP
How to check it worked
- Press late. Run off an edge and press jump a blink afterwards. You should still jump.
- Press early. Press jump just before landing. The square should hop again straight away, with no dead moment.
- Tap, then hold. A tap should give a small hop, and a long press a full jump.
- Cross the gap twenty times. A good run should make it. A sloppy run should fall short.
- Stop on a narrow platform. Let go of the key. The square should stay put and not slide off.
- Hand over the keyboard. Watch someone else play and say nothing. Their face tells you more than any list.
The blueprints linked above come with ready-made code, and Spielerando can hand them to your AI through an MCP connection. That needs a free account with Google or e-mail, and it never looks at your game or code.