Makecode Arcade
Intermediate
60 mins
Teacher/Student led
+55 XP

Build and Debug the Core Features

Pupils build a working platform game in MakeCode Arcade, adding movement, gravity, jumping and win/lose events, then run their program to find and fix at least one bug and record it in the Investigation Journal.

Teacher Class Feed

Load previous activity

    1 - What We're Building ~5 mins

    Illustration for What we're buildingToday you're a game programmer. The people who make the games you play don't write everything perfectly the first time — they build a small piece, run it, and watch what happens. When something goes wrong, that's called a bug, and finding and fixing it is a huge part of the job.

    Key point

    We're going to build a platform game where you guide a character across ledges to reach a goal — while dodging danger. Watch the board as we model each piece, then build it on your own device and press play to see what it does. Keep your Investigation Journal handy, because you'll be catching at least one bug today.

    2 - Introduction ~2 mins

    Platform games (often simplified as platformer or jump 'n' run games) are a video game genre of action games in which the goal is to move the player character between points in an environment. Platformers use in jumping and climbing to navigate the player's environment and reach their goal. Levels and environments feature uneven terrain and suspended platforms of varying height that requires use of the player character's abilities in order to traverse them.



    3 - Create a New Arcade Project ~2 mins

    Go to the arcade.makecode.com website and create a new project.

    4 - Create Your Sprite ~5 mins

    In this game you will control a sprite and move it from the start of the map, to the goal at the end.

    Key point

    Add the following code to your project to create your sprite and use the sprite editor to design your character.

    let mySprite = sprites.create(img`
        5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 
        5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 
        5 5 5 f f 5 5 5 5 f f 5 5 5 5 5 
        5 5 5 f f 5 5 5 5 f f 5 5 5 5 5 
        5 5 5 f f 5 5 5 5 f f 5 5 5 5 5 
        5 5 5 f f f f 5 5 f f f f 5 5 5 
        5 5 5 f f f f 5 5 f f f f 5 5 5 
        5 5 5 f f f f 5 5 f f f f 5 5 5 
        5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 
        5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 
        5 f 5 5 5 5 5 5 5 5 5 5 5 f 5 5 
        5 f f 5 5 5 5 5 5 5 5 5 f f 5 5 
        5 5 f f f f f f f f f f f 5 5 5 
        5 5 f f f f f f f f f f 5 5 5 5 
        5 5 5 f f f f f f f f 5 5 5 5 5 
        5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 
        `, SpriteKind.Player)
    

    5 - Move Left and Right ~6 mins

    In the game we will use the left and right buttons to move our sprite.

    Add the following new code:

    let mySprite = sprites.create(img`
        5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 
        5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 
        5 5 5 f f 5 5 5 5 f f 5 5 5 5 5 
        5 5 5 f f 5 5 5 5 f f 5 5 5 5 5 
        5 5 5 f f 5 5 5 5 f f 5 5 5 5 5 
        5 5 5 f f f f 5 5 f f f f 5 5 5 
        5 5 5 f f f f 5 5 f f f f 5 5 5 
        5 5 5 f f f f 5 5 f f f f 5 5 5 
        5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 
        5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 
        5 f 5 5 5 5 5 5 5 5 5 5 5 f 5 5 
        5 f f 5 5 5 5 5 5 5 5 5 f f 5 5 
        5 5 f f f f f f f f f f f 5 5 5 
        5 5 f f f f f f f f f f 5 5 5 5 
        5 5 5 f f f f f f f f 5 5 5 5 5 
        5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 
        `, SpriteKind.Player)
    controller.moveSprite(mySprite, 100, 0)
    
    Click the + to set the vx value to 100 and the vy value to 0. We set the vy value to 0 so that up and down buttons do not move the sprite.
    Test that you can move your character left and right but not up and down.


    Pupil practice · Investigation Journal
    Module 4 · Technology: a Coding Build, Micro:bit Data and Presenting Data
    Lesson 24 · Build and Debug the Core Features
    Download Investigation Journal sheet (PDF)
    DigitalSkills.org · 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 DigitalSkills.org 2017 - 2025. 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