Today you are coding in MakeCode Arcade. You will build Bat Battle at your device: a spaceship you steer, bats that fall, shots that score, and a game over when a bat hits you.
Before you run anything, think: what do you expect will happen when a bat reaches the bottom of the screen?
You will predict, build step by step, run the game, and fix bugs as you go.
Bat Battle has five parts:
Test each part before adding the next.
Open the MakeCode Arcade website using the link below and create a new project. You can call the project whatever you want.
Create a new Arcade project using the makecode.com website.
First let's create our player sprite.
Add the following code and choose the red space ship sprite:
let mySprite: Sprite = null
mySprite = sprites.create(img`
. . . . . . . c d . . . . . . .
. . . . . . . c d . . . . . . .
. . . . . . . c d . . . . . . .
. . . . . . . c b . . . . . . .
. . . . . . . f f . . . . . . .
. . . . . . . c 2 . . . . . . .
. . . . . . . f f . . . . . . .
. . . . . . . e 2 . . . . . . .
. . . . . . e e 4 e . . . . . .
. . . . . . e 2 4 e . . . . . .
. . . . . c c c e e e . . . . .
. . . . e e 2 2 2 4 e e . . . .
. . c f f f c c e e f f e e . .
. c c c c e e 2 2 2 2 4 2 e e .
c c c c c c e e 2 2 2 4 2 2 e e
c c c c c c e e 2 2 2 2 4 2 e e
`, SpriteKind.Player)
Click on the gray box in the sprite block to open the Editor. You can choose a sprite from the Gallery or you can paint your own sprite using the Editor.
You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.