Students read a whole game, match each job to its blocks, and change rules without breaking the game: a review of the course before the final challenge.
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 · Make 12 min
This lesson adds nothing new. Garden defender uses every idea in the course: sprites and positions, the controller, velocity, kinds and overlaps, lives, a timer with pick random, an if in on game update, and projectiles. The skill is reading: find the blocks that do one job, then change only those. It prepares students for Space dodger, where they build a game in milestones.
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.
On the board, draw a box for each job: make bugs, move, fire, hit, crash, change colour. Pairs come up and write the block for each.
Leave the map up: students use it to find where each change goes.
Play the next pair's garden. Can you find their apple's three parts in the blocks?
Finding the right block in a longer program. Ask them to name the job first, then point to its block.
| What you will see | A question to ask | The fix |
|---|---|---|
| The student changes the wrong block. | Which job does that block do? Find it in the match. | Use the map of jobs to find the block for the rule you want to change. |
| Apples appear but catching one does nothing. | What kind are the apples, and which overlap did you add? | Apples are Food; the overlap must be Player and Food. |
| Catching an apple gives many lives. | What happens to the apple after the catch? | Destroy it in the overlap, or the event runs every frame. |
One possible solution for each task. Other correct programs are fine.

let bug: Sprite = null
scene.setBackgroundColor(13)
info.setLife(3)
let gardener = sprites.create(img`
. 4 4 .
4 4 4 4
. 8 8 .
. 8 8 .
`, SpriteKind.Player)
gardener.setPosition(80, 110)
controller.moveSprite(gardener, 100, 0)
gardener.setStayInScreen(true)
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
let water = sprites.createProjectileFromSprite(img`
. 9 .
9 9 9
. 9 .
`, gardener, 0, -100)
})
game.onUpdateInterval(400, function () {
bug = sprites.create(img`
. 7 7 .
7 f f 7
7 7 7 7
. 7 7 .
`, SpriteKind.Enemy)
bug.setPosition(randint(10, 150), 0)
bug.vy = 30
})
sprites.onOverlap(SpriteKind.Projectile, SpriteKind.Enemy, function (sprite, otherSprite) {
sprite.destroy()
otherSprite.destroy()
info.changeScoreBy(1)
})
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
otherSprite.destroy()
info.changeLifeBy(-1)
})
game.onUpdate(function () {
if (info.score() >= 10) {
scene.setBackgroundColor(7)
}
})

let bug: Sprite = null
scene.setBackgroundColor(13)
info.setLife(3)
let gardener = sprites.create(img`
. 4 4 .
4 4 4 4
. 8 8 .
. 8 8 .
`, SpriteKind.Player)
gardener.setPosition(80, 110)
controller.moveSprite(gardener, 100, 0)
gardener.setStayInScreen(true)
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
let water = sprites.createProjectileFromSprite(img`
. 9 .
9 9 9
. 9 .
`, gardener, 0, -100)
})
game.onUpdateInterval(400, function () {
bug = sprites.create(img`
. 7 7 .
7 f f 7
7 7 7 7
. 7 7 .
`, SpriteKind.Enemy)
bug.setPosition(randint(10, 150), 0)
bug.vy = 30
})
sprites.onOverlap(SpriteKind.Projectile, SpriteKind.Enemy, function (sprite, otherSprite) {
sprite.destroy()
otherSprite.destroy()
info.changeScoreBy(1)
})
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
otherSprite.destroy()
info.changeLifeBy(-2)
})
game.onUpdate(function () {
if (info.score() >= 10) {
scene.setBackgroundColor(7)
}
})

let apple: Sprite = null
let bug: Sprite = null
scene.setBackgroundColor(13)
info.setLife(3)
let gardener = sprites.create(img`
. 4 4 .
4 4 4 4
. 8 8 .
. 8 8 .
`, SpriteKind.Player)
gardener.setPosition(80, 110)
controller.moveSprite(gardener, 100, 0)
gardener.setStayInScreen(true)
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
let water = sprites.createProjectileFromSprite(img`
. 9 .
9 9 9
. 9 .
`, gardener, 0, -100)
})
game.onUpdateInterval(800, function () {
bug = sprites.create(img`
. 7 7 .
7 f f 7
7 7 7 7
. 7 7 .
`, SpriteKind.Enemy)
bug.setPosition(randint(10, 150), 0)
bug.vy = 30
})
game.onUpdateInterval(3000, function () {
apple = sprites.create(img`
. . 7 .
. 2 2 .
2 2 2 2
. 2 2 .
`, SpriteKind.Food)
apple.setPosition(randint(10, 150), 0)
apple.vy = 25
})
sprites.onOverlap(SpriteKind.Projectile, SpriteKind.Enemy, function (sprite, otherSprite) {
sprite.destroy()
otherSprite.destroy()
info.changeScoreBy(1)
})
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
otherSprite.destroy()
info.changeLifeBy(-1)
})
sprites.onOverlap(SpriteKind.Player, SpriteKind.Food, function (sprite, otherSprite) {
info.changeLifeBy(1)
otherSprite.destroy()
})
game.onUpdate(function () {
if (info.score() >= 10) {
scene.setBackgroundColor(7)
}
})
Stretch: Add a second timer that sends a fast bug every 5 seconds. Where does each part of it go?
Support: Give students the apple's timer already made, and ask them only to add the Player–Food overlap.
In Garden defender, which block would you change to give the player 5 lives at the start?
set life to 3, in on start: change 3 to 5.
Next: Space dodger, the final challenge, built in milestones with less help each time.