Put the jump inside an if that asks whether the player is on the floor, so it only works from the ground.
In every platformer you can only jump when your feet are on something. Without that one rule, the player could climb the sky.
Last lesson the ball could be thrown up and came back down to a floor. Now the player jumps with A. A jump sets vy to a negative number. But where must the player be for a jump to make sense?
Make your prediction first. Help opens once you've locked it in.

scene.setBackgroundColor(9)
let player = sprites.create(img`
. 4 4 .
4 4 4 4
. 8 8 .
. 8 8 .
`, SpriteKind.Player)
player.setPosition(80, 20)
player.ay = 300
controller.moveSprite(player, 80, 0)
game.onUpdate(function () {
if (player.bottom > 100) {
player.bottom = 100
player.vy = 0
}
})
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
player.vy = -150
})
Look at the on A pressed block. Does anything ask where the player is?
Press A (space) once and watch. Then press it again and again, quickly.

scene.setBackgroundColor(9)
let player = sprites.create(img`
. 4 4 .
4 4 4 4
. 8 8 .
. 8 8 .
`, SpriteKind.Player)
player.setPosition(80, 20)
player.ay = 300
controller.moveSprite(player, 80, 0)
game.onUpdate(function () {
if (player.bottom > 100) {
player.bottom = 100
player.vy = 0
}
})
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
player.vy = -150
})
This version has the fix. Try to fly with it.

scene.setBackgroundColor(9)
let player = sprites.create(img`
. 4 4 .
4 4 4 4
. 8 8 .
. 8 8 .
`, SpriteKind.Player)
player.setPosition(80, 20)
player.ay = 300
controller.moveSprite(player, 80, 0)
game.onUpdate(function () {
if (player.bottom > 100) {
player.bottom = 100
player.vy = 0
}
})
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
if (player.bottom >= 100) {
player.vy = -150
}
})
This version jumps only if player bottom ≥ 100. Fill in what a press of A does.
| player bottom when A is pressed | A does |
|---|---|
| 100 (on the floor) | |
| 70 (rising) | |
| 95 (falling, nearly down) |
This is Leo's game. Fix it: A only jumps when the player is on the ground.
Drag an if into the on A pressed block, around set vy.
The question: player bottom ≥ 100 (from Logic, with bottom from Sprites).
Change the jump speed and the gravity. Pick the pair you like best.
Make the jump weaker or stronger: a smaller or bigger negative vy.
Then change ay: try 100 for the Moon, 600 for a heavy planet.
Fix the flying: A only jumps when the player is on the ground.
This ticks by itself when your blocks do what is asked.

scene.setBackgroundColor(9)
let ball = sprites.create(img`
. 2 2 .
2 2 2 2
2 2 2 2
. 2 2 .
`, SpriteKind.Player)
ball.setPosition(80, 10)
ball.ay = 200
A sprite starts still with ay 200. What is its vy after 1.5 seconds?
Make a runner. The player stays on the left; the world comes to them:
Gravity, a floor in on game update and a jump from the ground: the same blocks as your fixed jumper.
A timer (on game update every 1500 ms) makes a rock at x 160 near the floor, with a negative vx so it slides left.
A Player–Enemy overlap: destroy the rock and change life by -1.
A runner: gravity, a floor, a jump from the ground, rocks on a timer, and a hit costs a life.
This ticks by itself when your blocks do what is asked.
This kangaroo hops across a field, but only from the ground. Make it a moon kangaroo: weaker gravity and a gentler jump. Can it still only jump from the ground?
Students fix a jump that works in mid-air by putting it inside an if that checks the player is on the floor, then build a runner game. About 45 minutes.
Open the teacher guide: answers, solutions, slides and a worksheet.
A jump sets vy to a negative number (up). On its own, it works on every press, even in mid-air, so a player can climb the sky. The fix is an if around the jump: if player bottom ≥ 100 (the floor's height). The floor if from last lesson puts the bottom back at exactly 100 every frame the player sinks, so standing means bottom is 100. In real platformers, tilemaps give a ready-made "is on a wall" test; this is the same idea by hand.
Where the check belongs: around the jump, in the A event. Ask where the player must be for a jump to make sense.
Stretch: Add a coin in the air that is only reachable with a jump, worth a point.
Support: Give students the jumper (floor and jump done) as their Make starter, so they add only the rocks and the lives.
Next unit: levels, so the runner can get harder. Skillmaps: Jungle Jump Platformer and Monster Truck Racer (arcade.makecode.com/skillmaps) are platformers built with tilemaps, the engine's version of this floor.