Makecode Arcade
Beginner
40 mins
Teacher/Student led
+160 XP
Pupils work on their own device

Studio: Bat Battle

Students build Bat Battle in MakeCode Arcade through a PRIMM code-along, adding a player, falling enemies, projectiles, scoring and game-over events while debugging as they go.

Teacher Class Feed

Load previous activity

    1 - Start: What We're Building ~4 mins

    Illustration for Start: what we're buildingToday 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.

    2 - The Plan: Five Parts to Build ~2 mins

    Bat Battle has five parts:

    1. A spaceship that moves left and right.
    2. Bats that appear at the top in random places.
    3. Falling bats, so they come down towards you.
    4. Shots that hit a bat and score a point.
    5. Game over when a bat reaches you.

    Test each part before adding the next.


    3 - Start a New Project ~2 mins

    Open the MakeCode Arcade website using the link below and create a new project. You can call the project whatever you want.

    https://arcade.makecode.com

    4 - Create Your Player ~2 mins

    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)
    

    123learn · Online learning platform

    Unlock the full learning experience

    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.

    Hundreds of curriculum-aligned lessons
    Interactive activities in every lesson
    Printable resources & progress tracking
    Copyright Notice
    This lesson is copyright of Coding Ireland 2017 - 2026. Unauthorised use, copying or distribution is not allowed.
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more