Students keep the level in a variable, change it where the score changes with a goal that moves up, see why a level-up in on game update fires every frame, and add levels to their runner.
Load these into Waypoints Prepare: choose Load URL and paste the copied address, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.
Predict and Run 8 min · Investigate 12 min · Modify 8 min · Mix it up 3 min · Make 10 min · Fishing 4 min
A level is a variable that starts at 1 and changes by 1. The level-up is an if in the event where the score changes (here the coin overlap): if score ≥ goal, change level by 1, change goal by 5, splash and add an enemy. goal is a target that moves up, so the question is false again until 5 more coins.
The trap is the lesson's misconception: put if score ≥ 5 in on game update and it fires every frame while the score stays 5 or more, so the level races up. The splash uses join ("Level " + level), labelled copy-for-now.
Next lesson keeps what changes per level in a list.
On the slides at these points. Students can do the whole lesson on their own; these are for the room. In the deck, the Run, Modify and Make slides have the live playground in them (the tutorial link is the backup), and the notes above are in each slide's speaker notes.
One student counts up aloud; another rings (claps) when the count reaches the goal, then moves the goal up by 5. Then try without moving the goal.
Without the moving goal, every number after 5 rings.
Play the next pair's runner. Which level did you reach?
Where the level-up goes. When levels race up, ask how often that block runs.
| What you will see | A question to ask | The fix |
|---|---|---|
| The level races up as soon as the score reaches the goal. | Where is the level-up if, and how often does that block run? Does goal move up? | Put it in the event where the score changes, and change goal by 10 inside it. |
| The splash says Level 1 after the first level-up. | Is change level by 1 before or after the splash? | Change the level first, then splash. |
| The rocks get slower, not faster. | Which way do the rocks fly? | Left, so faster is more negative: change speed by -20. |
One possible solution for each task. Other correct programs are fine.

let enemy: Sprite = null
let level = 1
let goal = 3
function addEnemy () {
enemy = sprites.create(img`
a . . a
a a a a
a 1 1 a
a a a a
`, SpriteKind.Enemy)
enemy.setPosition(80, 10)
enemy.setVelocity(50, 40)
enemy.setBounceOnWall(true)
}
let player = sprites.create(img`
. 4 4 .
4 4 4 4
. 8 8 .
. 8 8 .
`, SpriteKind.Player)
controller.moveSprite(player)
player.setStayInScreen(true)
let coin = sprites.create(img`
. 5 5 .
5 5 4 5
5 4 5 5
. 5 5 .
`, SpriteKind.Food)
coin.setPosition(randint(10, 150), randint(10, 110))
info.setLife(3)
addEnemy()
sprites.onOverlap(SpriteKind.Player, SpriteKind.Food, function (sprite, otherSprite) {
otherSprite.setPosition(randint(10, 150), randint(10, 110))
info.changeScoreBy(1)
if (info.score() >= goal) {
level += 1
goal += 3
game.splash("Level " + level)
addEnemy()
}
})
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
info.changeLifeBy(-1)
otherSprite.setPosition(80, 10)
})

let enemy: Sprite = null
let level = 1
let goal = 5
function addEnemy () {
enemy = sprites.create(img`
a . . a
a a a a
a 1 1 a
a a a a
`, SpriteKind.Enemy)
enemy.setPosition(80, 10)
enemy.setVelocity(50, 40)
enemy.setBounceOnWall(true)
}
let player = sprites.create(img`
. 4 4 .
4 4 4 4
. 8 8 .
. 8 8 .
`, SpriteKind.Player)
controller.moveSprite(player)
player.setStayInScreen(true)
let coin = sprites.create(img`
. 5 5 .
5 5 4 5
5 4 5 5
. 5 5 .
`, SpriteKind.Food)
coin.setPosition(randint(10, 150), randint(10, 110))
info.setLife(3)
addEnemy()
sprites.onOverlap(SpriteKind.Player, SpriteKind.Food, function (sprite, otherSprite) {
otherSprite.setPosition(randint(10, 150), randint(10, 110))
info.changeScoreBy(1)
if (info.score() >= goal) {
level += 1
goal += 5
game.splash("Level " + level)
info.changeLifeBy(1)
addEnemy()
}
})
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
info.changeLifeBy(-1)
otherSprite.setPosition(80, 10)
})

let rock: Sprite = null
let speed = -60
let level = 1
let goal = 10
scene.setBackgroundColor(9)
let player = sprites.create(img`
. 4 4 .
4 4 4 4
. 8 8 .
. 8 8 .
`, SpriteKind.Player)
player.setPosition(30, 90)
info.setLife(3)
player.ay = 300
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
}
})
game.onUpdateInterval(1500, function () {
rock = sprites.create(img`
. e e .
e e e e
e e e e
. e e .
`, SpriteKind.Enemy)
rock.setPosition(160, 98)
rock.vx = speed
info.changeScoreBy(1)
if (info.score() >= goal) {
level += 1
goal += 10
speed += -20
game.splash("Level " + level)
}
})
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
otherSprite.destroy()
info.changeLifeBy(-1)
})
Open task: any program that does what the step asks.
Stretch: Win the game at level 5: an if inside the level-up with game over (win).
Support: Give students the level and goal variables in the Make starter, so they write only the if in the timer.
Why does a level-up go in the event where the score changes, not in on game update?
on game update runs every frame, so while the score stays high enough the level goes up every frame. In the event it is asked only when the score changes.
Next: a list per level, so each level can have its own background and speed. Skillmap: Jungle Jump Platformer (arcade.makecode.com/skillmaps) moves between level maps.