← Teacher guide

Will it work in Arcade?

Students judge which games suit Arcade by the building blocks each game needs, see that sprites pass through each other, change one building block to change a game's genre, then pitch and prototype a game that fits.

Arcade advanced skills · Final challenge: Power-ups and your own game · about 50 minutes · Open the student lesson

Classroom resources

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.

Students will be able to

Timing

Predict and Run 8 min · Investigate 12 min · Modify 12 min · Pitch card and prototype 15 min · Car 3 min

Before class

A game engine is the part of a game tool that does common jobs for you. Arcade's engine moves sprites by their speed and gravity, notices overlaps, keeps score, lives and a countdown, runs timers, fires projectiles and (outside this course) draws tilemaps: walls, floors and a scrolling camera made in a tile editor.

The rule of thumb for students: a game suits Arcade when it is made of those building blocks.

The key fact behind "realistic physics": an overlap is only an event. Sprites pass through each other unless blocks move or destroy them. The challenge primer has the full table. These engine facts were written from knowledge of Arcade; check anything a student disputes in the live editor.

Running the lesson

  1. Predict: most pick the dodger. Ask why the other three are hard; collect reasons on the board (3D, mouse, physics).
  2. Run: name each building block aloud as students point at it. Keep the list visible for the pitch card.
  3. Investigate: the first match is recipes; the second is verdicts. Ben's tower shows the biggest limit: sprites do not push each other. Contrast with the floor students built in Gravity and jumping: stopping one sprite is easy, real physics is not.
  4. Modify: two small changes give three genres. This is the lesson's main point: genres are recombinations of the same blocks.
  5. Make: pitch cards first, on paper. Partners check each other for 'needs 3D, physics or a mouse'. The prototype is deliberately small.
  6. Car: a worked example of 'possible with work'.

The hard part (on purpose)

Letting go of a dream game that Arcade can't make, and finding its core. Ask what the fun part is in one sentence and which building blocks it needs.

When students get stuck

What you will seeA question to askThe fix
A student's dream game is 3D, online or physics-heavy.What is the fun part of that game, in one sentence?Keep the fun part and change the form: a top-down 2D racer instead of a 3D one; a 'knock the cans' game where hit crates are destroyed instead of toppling.
The dodger's rocks still give points.Which kinds does the overlap block name?It must be Player and Enemy, and the falling sprite must be made of kind Enemy too.
Shots pass through the rocks.What kind is a projectile?Projectile. Add an overlap for Projectile and Enemy (a spiral from Projectiles).

Answers to the checks

  1. Predict: This whole catching game is about 15 blocks. Which idea could you build quickest from the same building blocks?
    Dodge falling rocks: it needs exactly the same building blocks (a sprite on the controller, things falling on a timer, an overlap), with a life lost instead of a point won. The other three each need something Arcade does not have built in.
  2. What does it need?: Match each game idea with the building blocks it needs most.
    Catch falling fruit → D. a timer, falling speed and an overlap; A space shooter → B. projectiles, kinds and lives; A platformer → A. gravity, jumping and tile floors and walls; Pong for two players → C. two players on one keyboard and bounce on wall; A zombie that hunts you → E. comparing positions every frame, or follow
  3. Fit or not?: How well does Arcade fit each idea? Match each idea with its verdict and the reason.
    Collect keys in a maze → B. Built for it: tilemaps make the walls, overlaps collect the keys; Chess or a card game → C. Possible with work: no mouse, so you move a cursor with the controller; A car that drives round corners → D. Possible with work: sprites cannot rotate, so you draw a picture for each direction; A 3D kart racer → E. Not a good fit: Arcade is only 2D, 160 × 120 pixels; Angry Birds with towers that topple → A. Not a good fit: there is no physics engine that makes things push and tumble
  4. Ben's tower: Ben is testing a toppling-tower game. He stacks two crates and drops a ball on them with gravity. The ball falls straight through the crates and off the screen. Why?
    An overlap is only an event: nothing pushes or stops a sprite unless your blocks do it, and Ben has no overlap event at all
    Sprites pass through each other. An overlap tells your blocks that two sprites touch; then your blocks decide what happens. Stopping a ball is a few blocks (like the floor you built in Gravity and jumping), but stacking and toppling like real objects needs a physics engine, which Arcade does not have.

Solutions

One possible solution for each task. Other correct programs are fine.

Modify › Catcher to dodger

The program as blocks
Show as code
let fruit: Sprite = null
scene.setBackgroundColor(9)
let basket = sprites.create(img`
    e . . . . . . e
    e e e e e e e e
    . e e e e e e .
    `, SpriteKind.Player)
basket.setPosition(80, 110)
controller.moveSprite(basket, 100, 0)
basket.setStayInScreen(true)
game.onUpdateInterval(1000, function () {
    fruit = sprites.create(img`
    . c c .
    c b c c
    c c c c
    . c c .
    `, SpriteKind.Enemy)
    fruit.setPosition(randint(10, 150), 0)
    fruit.vy = 40
    fruit.setFlag(SpriteFlag.AutoDestroy, true)
})
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
    otherSprite.destroy()
    info.changeLifeBy(-1)
})

Modify › Dodger to shooter

The program as blocks
Show as code
let fruit: Sprite = null
scene.setBackgroundColor(9)
let basket = sprites.create(img`
    e . . . . . . e
    e e e e e e e e
    . e e e e e e .
    `, SpriteKind.Player)
basket.setPosition(80, 110)
controller.moveSprite(basket, 100, 0)
basket.setStayInScreen(true)
game.onUpdateInterval(1000, function () {
    fruit = sprites.create(img`
    . c c .
    c b c c
    c c c c
    . c c .
    `, SpriteKind.Enemy)
    fruit.setPosition(randint(10, 150), 0)
    fruit.vy = 40
    fruit.setFlag(SpriteFlag.AutoDestroy, true)
})
sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
    otherSprite.destroy()
    info.changeLifeBy(-1)
})
controller.A.onEvent(ControllerButtonEvent.Pressed, function () {
    sprites.createProjectileFromSprite(img`
    5
    5
    `, basket, 0, -100)
})
sprites.onOverlap(SpriteKind.Projectile, SpriteKind.Enemy, function (sprite, otherSprite) {
    sprite.destroy()
    otherSprite.destroy()
    info.changeScoreBy(1)
})

Make › Pitch card

Open task: any program that does what the step asks.

Make › Prototype

The program as blocks
Show as code
scene.setBackgroundColor(15)
let ship = sprites.create(img`
    . . 1 . .
    . 1 1 1 .
    1 1 1 1 1
    `, SpriteKind.Player)
ship.setPosition(80, 100)
controller.moveSprite(ship)
let star = sprites.create(img`
    . 5 .
    5 5 5
    . 5 .
    `, SpriteKind.Food)
star.setPosition(randint(10, 150), randint(10, 60))
sprites.onOverlap(SpriteKind.Player, SpriteKind.Food, function (sprite, otherSprite) {
    otherSprite.setPosition(randint(10, 150), randint(10, 60))
    info.changeScoreBy(1)
})

Change a car that turns

Open task: any program that does what the step asks.

Stretch and support

Stretch: Pick a famous game and write two pitch cards: one for a version that fits Arcade, and a list of what would have to change. Or prototype the hard part first: a cursor moved with the controller for a board game.

Support: Give students a pitch card template with the building blocks listed as tick boxes, and three example ideas to choose from (catch, dodge, maze).

Exit ticket

Name one game Arcade is built for and one that is not a good fit, with a reason for each.

For example: a space shooter is built for it (projectiles, kinds and lives are built-in blocks); Angry Birds is not a good fit (sprites do not push or topple; there is no physics engine).

What each step is for

Where it leads

The optional lesson Your own game grows the prototype into a game in milestones. Beyond the course: tilemaps for mazes and platformers, animation frames, and extensions. Skillmaps (arcade.makecode.com/skillmaps): 3-in-a-row and Code an Adventure stretch the engine into genres it does not do out of the box. Games in text code (microStudio) and 3D engines are the next step for games Arcade cannot do.