Make games with blocks in the Arcade simulator. Sprites, movement, speed, overlaps, score and lives, timers, decisions and projectiles, ending in Space dodger, a game built in milestones.
Each lesson works two ways. Students can work through the online tutorial at their own pace (it checks their answers and saves their progress in their browser), or you can teach it to the whole class from the slides, then send students into the tutorial for the Modify and Make steps.
Every lesson guide has plain-language notes, the answers to every check, a solution for every task, and slides and a worksheet for Waypoints Prepare. These guide pages are not linked from student pages, but they are not secret either: keep printed Teacher editions for answers you do not want students to find.
Whole-course cheat sheet: Open to print (every command, grouped by unit: a handout for the final challenge)
Put sprites on the screen, and move them with the controller and with speed.
An Arcade game is made of sprites: small pictures the game can place, move and test. The screen is 160 pixels across and 120 down.
The simulator (the little game console beside the blocks) runs the game straight away. Click it first so it hears the keyboard: arrow keys or W, A, S, D move, space or Z is A.
Every 2D game is pictures on a grid, moved. A game engine saves work: you say where a sprite starts and how fast it goes, and the engine draws every frame. Velocity is how clouds drift, cars drive and balls fly without a single loop.
A position is a pin on a map: it says where you are now. A velocity is cruise control in a car: set it once, and the car keeps going at that speed until you brake.
Where it breaks: setting a speed is not "move this far". A sprite with vx 30 does not stop after 30 pixels; it drives off the edge of the screen unless something stops it (stay in screen, bounce on wall, or a new velocity).
Next unit sprites notice each other: an overlap event runs when two sprites touch. Velocity returns with timers (enemies that fly in), chasing, and gravity, which is a change of velocity every frame.
Cheat sheet: Open to print (A4, with a picture of what each command draws) · Markdown
Overlaps as events, kinds, score, lives and timers.
Sprites pass through each other, but the game notices when they overlap (touch). Three ideas make that into a game:
A timer event, on game update every 1000 ms, runs its blocks again every so many milliseconds (1000 ms is one second). It can make a new enemy each time.
Nearly every game rule is "when this touches that, do something": eat the dot, lose a life, open the door. Kinds let one event cover every coin in the game. Info and timers are jobs the engine does for you, so a game can be built in a lesson.
Kinds are like coloured wristbands at a school sports day: the rule "red meets blue, blue scores a point" works for every child, whatever their name. A child with the wrong wristband is ignored by the rule.
Where it breaks: an overlap is not a single tap. It runs every frame (about 30 times a second) while the sprites still touch. An enemy that is not destroyed or moved away takes a life every frame, and the game ends at once.
The Decide unit adds if inside on game update, checked every frame (wrap-around, safe zones, chasers). Projectiles bring another kind, and the final challenge, Space dodger, is this unit's dodge game grown up.
Cheat sheet: Open to print (A4, with a picture of what each command draws) · Markdown
If and else, checked every frame: wrap-around, safe zones and chasers.
An if block asks a yes-or-no question (a condition), such as car x > 160. When the answer is yes (true), it runs the blocks inside. When it is no (false), it skips them and does nothing.
else adds an "otherwise": exactly one of the two parts runs. else if adds more questions, asked from the top; the first true one runs and the rest are skipped.
In Arcade the big question is when an if is asked. A game redraws the screen about 30 times a second; each drawing is a frame. on game update runs its blocks every frame, so an if inside it keeps asking for as long as the game runs. on start runs once, before the game begins, so an if there is asked one time and never again.
Comparisons are in Logic: < less than, > greater than, ≤ and ≥ with "or equal to". A sprite's x and y blocks are in Sprites. Remember y counts down the screen.
Decisions are what make a game react: wrap around when you leave the screen, change the music in a safe zone, turn an enemy towards you, make a guard turn at the end of its walk. Each one is a position (a number) and a question, asked every frame.
A lifeguard watching the pool: every few seconds she asks "is anyone in the deep end who shouldn't be?", and acts the moment the answer is yes. That is an if in on game update. An if in on start is a lifeguard who looks once when the pool opens, sees nobody, and goes home.
Where it breaks: a lifeguard blows her whistle once. An if in on game update acts every frame while its question stays true, so anything inside it (a point, a lost life) happens 30 times a second unless the blocks inside also make the question false (as wrap-around does by moving the car back to x 0).
Next unit fires projectiles, steered by the same if and else. In Arcade advanced skills the same idea gives a floor for jumping (if the player's bottom is below the ground, stop falling), and the Level up lesson shows the trap from the other side: an if that stays true in on game update fires every frame.
Cheat sheet: Open to print (A4, with a picture of what each command draws) · Markdown
Projectiles, then read a whole game and change it.
A projectile (in Sprites) is a sprite fired from another sprite, with a speed across and down. It has its own kind, Projectile, so the overlap that catches a hit names Projectile and Enemy, not Player. The engine removes a projectile once it leaves the screen.
Read a game is a review lesson with nothing new: a complete game, longer than anything so far. Students find the blocks that do each job (make an enemy, fire, score a hit), trace what they do, and change just those to change the game.
Firing is the heart of every shoot 'em up, and its kind keeps a shot's rules apart from the player's. Reading before changing is how programmers work on code they did not write: find the part that does the job, change only that.
A projectile is a ball thrown by a player: once it leaves the hand, it flies on its own.
Where it breaks: in a game the ball is not the player, so "the player touched the enemy" never sees a hit by the ball. The game needs a rule for the ball's own kind.
The final challenge, Space dodger, uses rocks, lives, timers and decisions together. Arcade advanced skills starts with every sprite of a kind: one press that does something to every alien at once.
Cheat sheet: Open to print (A4, with a picture of what each command draws) · Markdown
Build a dodging game in milestones, with less help each time.
The challenge builds Space dodger: a ship moves up and down, rocks fly in from the right, a hit costs a life, and the score counts the seconds you survive. It uses every idea from the course, with only two new blocks:
The lesson is built in three milestones with less help each time: most of the code, then an outline, then goals only. Finishing it marks the course Challenge complete.
Real programs are combinations: variables, events, decisions and timers working together. Building in milestones keeps a game playable at every stage, so each change can be tested by playing. Game studios work the same way: prototype, playtest, change one thing.
Milestones are building a cubby house: first a floor you can stand on, then walls, then a roof. You can use it after every step.
Where it breaks: a cubby's floor stays put, but code that worked can stop working when you add the next part. Play the game after every milestone, not only at the end.
This ends Arcade Foundations. Arcade advanced skills goes on to every sprite of a kind, functions, gravity and jumping, levels and power-ups. Microsoft's Beginner Skillmap (arcade.makecode.com/skillmaps) practises the same moves inside guided games.
Cheat sheet: Open to print (A4, with a picture of what each command draws) · Markdown
Self-paced briefs students can pick up after the lesson named on each. Students tick their own milestones and claim a badge; the page lights the skills their code uses. Badges stay in the student's browser: ask them to press Show your teacher. Open the projects page
Make a collecting game: the player moves around, treasure appears in random places, collecting it scores, and something changes when the score gets high enough (the background, the speed, a message). Your own player, treasure and setting.
Milestones:
All blocks from Arcade Foundations lessons 1 to 7. Students who want art can draw their own sprites in the image editor; set a time limit on drawing.
scene.setBackgroundColor(7)
let hero = sprites.create(img`
. 2 2 .
2 2 2 2
2 2 2 2
. 2 2 .
`, SpriteKind.Player)
controller.moveSprite(hero)
hero.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))
sprites.onOverlap(SpriteKind.Player, SpriteKind.Food, function (sprite, otherSprite) {
info.changeScoreBy(1)
otherSprite.setPosition(randint(10, 150), randint(10, 110))
if (info.score() >= 10) {
scene.setBackgroundColor(9)
}
})
Make a chase game: enemies follow the player around the screen, and the player has to survive, reach a goal or collect things to escape. How the enemies move, and how you win, are your choice.
Milestones:
The usual bug is losing all lives at once: the enemy must be destroyed or moved away in the overlap, as in Score and lives. Ask students to say how the enemy decides which way to go before they build it.
scene.setBackgroundColor(1)
info.setLife(3)
let hero = sprites.create(img`
. 8 8 .
8 8 8 8
8 8 8 8
. 8 8 .
`, SpriteKind.Player)
controller.moveSprite(hero)
hero.setStayInScreen(true)
let ghost = sprites.create(img`
2 2 2 2
2 f 2 f
2 2 2 2
2 . 2 .
`, SpriteKind.Enemy)
ghost.setPosition(randint(0, 160), 0)
game.onUpdate(function () {
if (ghost.x < hero.x) {
ghost.vx = 30
} else {
ghost.vx = -30
}
if (ghost.y < hero.y) {
ghost.vy = 30
} else {
ghost.vy = -30
}
})
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
info.changeLifeBy(-1)
otherSprite.setPosition(randint(0, 160), 0)
})
info.startCountdown(30)
info.onCountdownEnd(function () {
game.over(true)
})