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

From Blocks to Text in Makecode Arcade

Students build a simple pixel character in MakeCode Arcade, move it with the controller, and begin reading the same project in the JavaScript view so they can see how familiar blocks map to text.

Teacher Class Feed

Load previous activity

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

    Illustration for Start: what we're buildingToday you are working in MakeCode Arcade on a new project from scratch.

    You will craft your own pixel character, make it move with the arrow keys, run it in the simulator, and take a first look at how the same project reads in the JavaScript text view.

    Before you build, think: what do you expect to see when a sprite is created and the controller is told to move it?

    2 - Creating a New Project ~4 mins

    Start by creating a new project on MakeCode Arcade. You can do this by going to the MakeCode Arcade website here and clicking on 'New Project'.

    3 - Creating a Sprite ~7 mins

    Build it in blocks first. A new project opens in the Blocks view, and that is where you start. From Sprites, drag in set mySprite to sprite of kind Player and draw your character in the pixel editor that opens when you click the grey square.

    Now look at what you just made. At the top of the editor click the JavaScript toggle. Your block has not gone anywhere, it is the same program written as text:

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

    Read it against your block and match the pieces up: set mySprite to became let mySprite =, sprite became sprites.create, your drawing became the img`...` part, and of kind Player became SpriteKind.Player. Nothing new has happened. The same instruction is just written a second way.

    Flip back to Blocks. Still there. You can move between the two views as often as you like.

    4 - Animating the Sprite ~8 mins

    Back in the Blocks view, add move mySprite with buttons from Controller. Run it, and your character moves with the arrow keys.

    Flip to JavaScript again and find the line your new block became:

    controller.moveSprite(mySprite)

    Same pattern as before. The block's name became controller.moveSprite, and the sprite you chose in the dropdown became the mySprite in the brackets. Predict before you look: if you had two sprites, what would you expect to change in that line?

    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