Workshop › Mario-style Platformer › Step 17 of 37
Run toward a ledge and press jump at the very edge: very often the player has just stepped off, a frame or two too late, and the game says no. The fix is coyote time: a counter that is full while grounded and runs down for a few frames after leaving the ground.
```js
const COYOTE = 6 // frames you can still jump after running off a ledge
let coyote
coyote = 0
coyote = player.grounded ? COYOTE : Math.max(0, coyote - 1)
```coyote starts at 0 in loadLevel.updatePlayer: grounded refills it to 6; in the air it counts down, never below 0.CUT write COYOTE; above const keys = {} write let coyote.loadLevel, after the forEach block's }), write coyote = 0.updatePlayer, under moveY(player), write the coyote line.Skills: Game states