Makecode Arcade
Intermediate
60 mins
Teacher/Student led
+150 XP
Pupils work on their own device

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

    A platform game is a game where you guide a character across ledges and platforms to reach somewhere. Mario, Sonic and Hollow Knight all work this way. The ground is never flat: there are gaps to clear, ledges at different heights and platforms hanging in mid-air, so the only way forward is to run and jump.

    That means your character needs a small set of abilities — moving left and right, jumping, and something to avoid — and the level is built to test them. Everything you are about to code today is one of those abilities.



    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

    A sprite is a character or object in the game that the code can move around. In this game you will control one 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. Clicking the little picture inside the block opens the sprite editor, a grid where you colour in your character square by square.

    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 + on the block to show two speed settings. vx is the speed left and right, and vy is the speed up and down. Set vx to 100 and vy to 0. With vy at 0 there is no up-and-down speed at all, so the up and down buttons will 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)
    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 - 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