Wall Jump
A wall jump lets the character jump off a wall in the air. Kick it up and away from the wall, and fix its sideways speed for a short lock time so that holding toward the wall cannot cancel the kick. Let a press just after leaving the wall still count.

Paste this to your AI
Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.
Add "Wall Jump" to my game.
What it should do: A jump off a wall lets the player climb between walls, rescue a fall and reach places no ground jump reaches, with the wall as the one thing to push against.
Build it exactly as this state machine. First check that it fits my game, then build it like this:
```mermaid
stateDiagram-v2
[*] --> ground
ground: On the ground
air: In the air
wall: At a wall
kicked: Kicked off
ground --> air: jumps or steps off
air --> ground: lands
air --> wall: touches a wall
air --> kicked: late press near a wall
wall --> air: leaves the wall
wall --> ground: lands
wall --> kicked: presses jump
kicked --> air: lock time ends
kicked --> wall: lock ends at a wall
kicked --> ground: lands
```
Use these starting values:
- jumpSpeed: 12 units/s
- kickSpeed: 8 units/s
- lockTime: 0.18 s
- graceTime: 0.1 s
- runSpeed: 7 units/s
- gravity: 32 units/s²
- maxFallSpeed: 20 units/s
Watch out for these common mistakes:
- Holding toward the wall: Tell your AI: fix the sideways speed for a short lock time after the kick and ignore the steering until it is over.
- A press a little too late: Tell your AI: remember the last wall and its side for a short grace time and kick off it when a press comes in time.
- The kick adds to the speed: Tell your AI: set the speeds of the kick, never add to the old ones.
- Pressing fast on one wall: Tell your AI: allow no new kick until the lock time is over, and use up the grace time with each kick.
- A wall next to the ground: Tell your AI: a press on the ground is always the ordinary jump. A wall only counts in the air.
Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP
What it does
A jump off a wall lets the player climb between walls, rescue a fall and reach places no ground jump reaches, with the wall as the one thing to push against.
How it runs, as a diagram
Everything it can be in, and what moves it on. Your AI builds from exactly this.
How it runs, as a diagram
- On the ground → In the air: jumps or steps off
- In the air → On the ground: lands
- In the air → At a wall: touches a wall
- In the air → Kicked off: late press near a wall
- At a wall → In the air: leaves the wall
- At a wall → On the ground: lands
- At a wall → Kicked off: presses jump
- Kicked off → In the air: lock time ends
- Kicked off → At a wall: lock ends at a wall
- Kicked off → On the ground: lands
Good starting values
| Value | Start with | What it changes |
|---|---|---|
| jumpSpeed | 12 units/s | How hard the character pushes up, from the ground and off a wall. The same as the ground jump on the other movement pages, so a wall jump is neither weaker nor stronger than a normal jump. |
| kickSpeed | 8 units/s | How fast the character is pushed away from the wall. A little above the running speed, so the kick clearly leaves the wall. Too low and the character drifts back into it. |
| lockTime | 0.18 s | How long the push away cannot be steered. At the starting values the character gets about one and a half units away from the wall, then the player is in control again. Zero turns the lock off. |
| graceTime | 0.1 s | How long after leaving a wall a press still counts as a wall jump. A tenth of a second forgives a press that comes a little late. Zero asks for a press while touching. |
| runSpeed | 7 units/s | The sideways speed when the player steers. Below the kick speed, so the kick is the faster move. |
| gravity | 32 units/s² | How fast a rise slows down and a fall speeds up. |
| maxFallSpeed | 20 units/s | The fastest the character can fall. |
What usually goes wrong
Holding toward the wall
A player who holds toward the wall while pressing jump cancels the kick on the next tick, and the character hops straight up the wall instead of away from it.
Fix: Tell your AI: fix the sideways speed for a short lock time after the kick and ignore the steering until it is over.
A press a little too late
Players press jump a few ticks after the wall is gone and think they did it right. Without a grace time the press does nothing and the game feels broken.
Fix: Tell your AI: remember the last wall and its side for a short grace time and kick off it when a press comes in time.
The kick adds to the speed
A kick that adds to the speed is weak after a fast fall and huge on the way up, and fast presses shoot the character up the wall.
Fix: Tell your AI: set the speeds of the kick, never add to the old ones.
Pressing fast on one wall
If every press on a wall kicks, a player who mashes the button climbs one wall for as long as they like, because the character is still touching it after the kick.
Fix: Tell your AI: allow no new kick until the lock time is over, and use up the grace time with each kick.
A wall next to the ground
A press on the ground next to a wall is read as a wall jump, so the ordinary jump suddenly flies sideways away from the wall.
Fix: Tell your AI: a press on the ground is always the ordinary jump. A wall only counts in the air.
How to check it works
- Your character falls next to a wall on its right. Press jump: The character rises at the jump speed and is pushed to the left at the kick speed.
- Your character falls next to a wall, once on the left and once on the right. Press jump: Both times the kick goes away from the wall.
- Your character is next to a wall. Press jump once while falling fast and once while still rising: Both times the upward speed is the same.
- Your character has just been kicked off a wall. The player holds toward the wall during the lock time: The character keeps moving away at the kick speed.
- Your character has been kicked off a wall. The lock time is over and the player holds a direction: The character moves at the running speed in that direction.
- Your character left a wall a few ticks ago, less than the grace time. Press jump: The character kicks away from the wall it left.
- Your character left a wall longer ago than the grace time. Press jump: Nothing happens and the character keeps falling.
- Your character falls in open air. Press jump: Nothing happens.
- Your character stands on the ground next to a wall. Press jump while holding toward the wall: The character makes an ordinary jump and is not pushed away.
- Your character has just been kicked off a wall that still touches it. Press jump again: Nothing new happens, the first kick goes on.
- Your character is kicked off a wall with a long lock time, and the ground comes up to meet it before the lock is over. It reaches the ground: The lock ends and the player steers freely.
Works well with
- Wall Slide: The slide keeps the character next to the wall long enough to jump. A jump that starts from a slide should still set the speed, so it does not inherit the slow slide. Check for the wall jump before the slide on every tick.
- Coyote Time: One is for the ground edge and one for the wall, and a press near both should prefer the wall that is actually still touching. Both use a short grace time. Keep them as two separate timers.
- Jump Buffering: A remembered press then kicks on the first tick the wall touches, which makes tight climbs between two walls much easier. Remember a press that comes just before the wall is touched.
Clashes with Double Jump: A press in the air next to a wall can mean a kick off the wall or an air jump. Kick first when a wall is there and keep the air jump for the open air.
Common questions
what do i tell my ai to add a wall jump
Paste this: Add a wall jump: a press in the air next to a wall, or a few ticks after leaving it, sets the speed up and away from the wall. Fix the sideways speed for a short lock time so holding toward the wall cannot cancel it, and allow no second kick until the lock is over.
why does my wall jump go straight up the wall
The player is holding toward the wall and the steering overrides the kick on the next tick. Fix the sideways speed for a short moment after the kick and ignore the steering until it ends.
should a wall jump be as strong as a normal jump
A good start is the same upward speed, with a sideways push a little above running speed. Weaker makes walls a trap, and much stronger makes the ground jump pointless next to a wall.
can the player climb one wall by jumping off it again and again
Only if you allow it. Here a new kick waits for the lock time to end, and each kick uses up the grace time, so one touch gives one kick. Climbing needs a second wall, or you can lengthen the lock.
Where it comes from
We could not find a reliable origin for this one yet.
What was checked
- 19 tests pass on the reference code.
- The state diagram was checked against the code, at the default values and at every listed low and high value.
Your AI gets the code
Tested example code comes through the Spielerando connection, so your AI can use it right away. How to connect it