11 / Jumping
Jump buffering
remember the press, act on landing
The wall in the demo stands just past the landing spot, so the runner has to take off again the instant it touches down. A player aiming for that presses slightly early, while still in the air. Without a buffer, that press simply vanishes. With one, the game holds on to it and jumps as soon as the runner is grounded, or inside its coyote window.
- Jumps, especially chains of them
- Attacks and dashes in combos
Press Jump, or press on the scene, to play. If the scripted runner has already pressed, or a round has just ended, your first press starts a fresh round for you.
Prompts to paste
Early jump presses just before landing are being lost. Store each press with a timestamp and treat it as live for about 0.12 s; on any frame where the character is allowed to jump (grounded or in coyote time), consume a live press and jump. Consuming it clears the timestamp.
Add input buffering for jump. On a jump press, set jumpBufferTimer to a tunable 0.1 s, and reduce it by dt every frame. After ground detection in the movement update, if the timer is still positive and the character can jump (grounded or within coyote time), start the jump and set the timer to 0. Apply the same pattern to attack and dash, so inputs made a few frames early still count.
Examples
Bouncing between platforms
Chains of jumps feel smooth because each press can come a little before touchdown.
Not just jumping
Attacks, dashes and rolls benefit from the same buffer, so combos don't need frame-perfect timing.
Works with coyote time
Check the buffer whenever a jump becomes possible, including inside the coyote window.
Pitfalls
Remembering too long
A press from half a second ago fires out of nowhere. Keep the buffer short.
Not clearing it
Leaving the press in the buffer after it fires lets a single press cause a second jump on the next landing.
Reading it before ground checks
If the buffer is checked before the character is marked grounded this frame, the jump fires a frame late.
Starting values
| Setting | Value | Note |
|---|---|---|
| Buffer | 80–150 ms | 5–9 frames at 60 fps |
| Cleared | the moment the action fires |