Spielerando

Double Jump

A double jump lets the character jump again in mid-air. Count the air jumps, use one per press and fill the count up again on landing. Set the upward speed instead of adding to it, so the jump feels the same rising or falling and fast presses cannot launch the character into the sky.

Also called: Air jump, Midair jump, Multi-jump.

A low-poly capybara in goggles and a yellow scarf kicks off a puff of blue cloud in mid-air between two floating mesas, and a dotted path bends upward at the puff towards the far island.
Mesa Hopper, an invented low-poly sky platformer. Invented game, image generated with AI.

Paste this to your AI

Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.

Add "Double Jump" to my game.

What it should do: A second jump gives the player control in the air: a way to fix a misjudged jump, reach further or recover from a fall.

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
  ready: Air jump left
  spent: None left
  ground --> ready: jumps or walks off
  ground --> spent: press while walking off
  ready --> ready: air jump, more left
  ready --> spent: last air jump
  ready --> ground: lands
  spent --> spent: press does nothing
  spent --> ground: lands
```

Use these starting values:
- airJumps: 1
- jumpSpeed: 12 units/s
- airJumpSpeed: 10 units/s
- gravity: 32 units/s²
- maxFallSpeed: 20 units/s

Watch out for these common mistakes:
- The air jump adds to the speed: Tell your AI: set the speed to the air jump speed, never add to it.
- Walking off a ledge: Tell your AI: fill up the air jumps on the ground, not on the jump, and decide if a fall uses one up. Here it does not.
- A late press near a ledge: Tell your AI: look at coyote time before the air jump.
- Landing and pressing at the same moment: Tell your AI: handle the landing while moving the character, and decide on jumps from where the character was when that step started.

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 second jump gives the player control in the air: a way to fix a misjudged jump, reach further or recover from a fall.

How it runs, as a diagram

Everything it can be in, and what moves it on. Your AI builds from exactly this.

jumps or walks offpress while walking offair jump, more leftlast air jumplandspress does nothinglandsOn the groundAir jump leftNone left
How it runs, as a diagram
  • On the ground → Air jump left: jumps or walks off
  • On the ground → None left: press while walking off
  • Air jump left → Air jump left: air jump, more left
  • Air jump left → None left: last air jump
  • Air jump left → On the ground: lands
  • None left → None left: press does nothing
  • None left → On the ground: lands

Good starting values

ValueStart withWhat it changes
airJumps1How many jumps the character has in the air. Zero turns it off.
jumpSpeed12 units/sHow hard the character pushes off from the ground.
airJumpSpeed10 units/sHow hard the air jump pushes. A little under the ground jump keeps the ground jump the stronger one.
gravity32 units/s²How fast a rise slows down.
maxFallSpeed20 units/sThe fastest the character can fall, and so the worst fall an air jump has to recover from.

What usually goes wrong

The air jump adds to the speed

An air jump that adds to the speed is weak in a fall and huge on the way up, and fast presses launch the character into the sky.

Fix: Tell your AI: set the speed to the air jump speed, never add to it.

Walking off a ledge

If the air jumps only come back after a ground jump, a character that walks off a ledge has none left, or one too many, depending on how it was built.

Fix: Tell your AI: fill up the air jumps on the ground, not on the jump, and decide if a fall uses one up. Here it does not.

A late press near a ledge

With coyote time, a press just after a ledge uses up the air jump although it was meant as the ground jump.

Fix: Tell your AI: look at coyote time before the air jump.

Landing and pressing at the same moment

A press at the moment of landing can count as an air jump if the game decides on the air jump before the landing.

Fix: Tell your AI: handle the landing while moving the character, and decide on jumps from where the character was when that step started.

How to check it works

Works well with

Clashes with Jump Buffering: A press in the air can mean an air jump now or a remembered jump on landing. Use the air jump first, and remember the press only when none is left.

Common questions

what do i tell my ai to add a double jump

Paste this: Add a double jump: give the character one air jump, use it up on a press in the air, set the upward speed instead of adding to it, and fill it up again on landing.

should a double jump add to velocity or set it

Set it. Adding makes the jump weak in a fall and huge while rising, and lets fast presses launch the character into the sky.

should a double jump be weaker than the first jump

Usually a little. A start of about five sixths of the ground jump's speed keeps the ground jump the main one while the air jump still rescues a fall.

does walking off a ledge use up the double jump

That is your choice. Here it does not: the character keeps its air jump, which feels more forgiving. To use it up, take one off the count when the character leaves the ground without a jump.

Where it comes from

Earliest example we could find: Dragon Buster (Namco, arcade) (1984). Game Informer, Guinness World Records and Destructoid all connect the double jump with this game, in which the hero Clovis jumps again in mid-air. The year follows Guinness (December 1984) and the Arcade Archives release text (1984). Game Informer says 1985, and Wikipedia gives January 1985 for Japan. No contemporary or developer source for the mechanic was found.

  1. 1984 Dragon Buster (Namco, arcade): Game Informer, Guinness World Records and Destructoid all connect the double jump with this game, in which the hero Clovis jumps again in mid-air. The year follows Guinness (December 1984) and the Arcade Archives release text (1984). Game Informer says 1985, and Wikipedia gives January 1985 for Japan. No contemporary or developer source for the mechanic was found. [First videogame to use the "double jump" (Guinness World Records)][An Ode To The Most Important Power-Up: Double Jump (Ben Reeves, Game Informer, 2014-11-04)][Announcing the release date of Arcade Archives DRAGON BUSTER (press release on Game Developer, 2021-12-09)][Relive the dawn of dungeon crawling with Arcade Archives' Dragon Buster (Chris Moyse, Destructoid, 2021-12-12)]
  2. 1984 Super Mario Bros. test version (Nintendo, internal): In Iwata Asks, Miyamoto recalls asking for a test version around December 1984 in which repeated button presses made Mario jump in the air as well. This was an unreleased experiment, and the source does not call it a double jump. It shows the idea being tried elsewhere at about the same time, not a link to Dragon Buster. It is the only developer statement on repeated mid-air jumping found for this period. [Iwata Asks: Super Mario Bros. 25th Anniversary, Vol. 5: Original Super Mario Developers, 1. Using the D-pad to Jump (Nintendo)]
  3. 1991 Super Ghouls 'n Ghosts (Capcom, Super Nintendo): Nintendo Life credits this game with popularising the double jump and says its level design is built around the move. A second press during a jump launches Arthur again. The Game Informer writer also names it as where he met the ability. The popularising claim is the reviewer's judgement. [Super Ghouls 'n Ghosts Review (Damien McFerran, Nintendo Life, 2013-05-23)][An Ode To The Most Important Power-Up: Double Jump (Ben Reeves, Game Informer, 2014-11-04)]
  4. 2014 Ben Reeves, 'An Ode To The Most Important Power-Up: Double Jump' (Game Informer): A trade-press essay traces the double jump from platformers into action games and shooters, naming Super Smash Bros., Castlevania: Symphony of the Night, Titanfall and Unreal Tournament. It is a personal appreciation rather than a researched history, and the only year it gives is for Dragon Buster. [An Ode To The Most Important Power-Up: Double Jump (Ben Reeves, Game Informer, 2014-11-04)]
  5. 2019 The Messenger (Sabotage), 'Cloudstep', Game Design Deep Dive: A developer account of reworking the mechanic: instead of a fixed extra jump, the player regains jumps in the air by landing attacks. The article presents this as a twist on the established double jump, which shows the mechanic was by then a convention that designers vary. The year is the article's date. [Game Design Deep Dive: Re-imagining the double jump in The Messenger (Game Developer, 2019-05-23)]

Dragon Buster is the earliest game opened sources describe as having a double jump, but the evidence is thin: late secondary sources repeating each other, with no developer statement and no contemporary description found. Source claims: Guinness World Records titles its entry 'First videogame to use the double jump' and says Clovis was the first digital hero to do the move; Game Informer hedges with 'reportedly originated'; Destructoid says the game is considered one of the first; Wikipedia calls it the earliest game with the mechanic but cites only Game Informer. These are those sources' claims, not this project's. Date dispute: Guinness says December 1984 and the Arcade Archives text says 1984, Destructoid also says 1984, while Game Informer says 1985 and Wikipedia says January 1985 in Japan, citing Akagi's arcade list, which could not be checked directly. Both could be true if the copyright or location-test date differs from general release, but no source says so. The Guinness entry also says the game reached the NES in 1985, which was not verified, so its dates deserve caution. Earlier candidate: Pac-Land (Namco, 1984, with Wikipedia giving August or October) has boots, on a return trip, that let Pac-Man keep jumping in the air. It may predate Dragon Buster, but it is a limited power-up allowing unlimited air jumps, no source opened here calls it a double jump, and the only source is Wikipedia citing a later Atari Lynx manual. It is kept out of the timeline as a judgement call, and a reviewer using a broad definition (any mid-air jump) could prefer it. Miyamoto's December 1984 test version is similar: real, but unreleased and not called a double jump. Pointer outcome: the Wikipedia page 'Double jumping' does not exist; the term now points to a glossary definition with no history. The Dragon Buster article carries the claim instead. How the move was performed in Dragon Buster is undocumented here, because the only page describing it could not be opened. Symphony of the Night, Super Smash Bros. and Maria Renard in Rondo of Blood were seen only as unsupported mentions or weak fan pages, so they get no dated events. No source was found on who coined the term.

Games are named only as references. Names and marks belong to their owners, and nothing here is endorsed by them.

What was checked

This is what separates the blueprint from a catalogue entry: the values on this page come from code that runs.

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