Makecode Arcade
Beginner
60 mins
Teacher/Student led
+150 XP
What you need:
Chromebook/Laptop/PC or iPad/Tablet

Pumpkin Catch

Get started with creating a fun Halloween-themed game! You'll build a project in MakeCode Arcade, design a ghost character, control its movements, add falling pumpkins and stones, manage lives, and track scores step by step.
Learning Goals Learning Outcomes Teacher Notes

Teacher Class Feed

Load previous activity

    1 - Introduction

    Today, we're going to have lots of fun making a spooky Halloween game called Pumpkin Catch. You'll create a friendly ghost that you can move around to catch falling pumpkins and get points. But watch out for the falling stones – they might take away your lives! We'll build everything step by step using code. Are you ready to start your adventure?


    2 - Create a new project

    Go to MakeCode Arcade and create a new project. Name your project 'Pumpkin Catch'.

    3 - Create the ghost character

    Let's create the ghost that you will control to catch pumpkins. We will use code to make a sprite for the ghost.

    Add the following code and choose the ghost sprite from the gallery:

    let mySprite = sprites.create(img`
        ........................
        ........................
        ........................
        ........................
        ..........ffff..........
        ........ff1111ff........
        .......fb111111bf.......
        .......f11111111f.......
        ......fd11111111df......
        ......fd11111111df......
        ......fddd1111dddf......
        ......fbdbfddfbdbf......
        ......fcdcf11fcdcf......
        .......fb111111bf.......
        ......fffcdb1bdffff.....
        ....fc111cbfbfc111cf....
        ....f1b1b1ffff1b1b1f....
        ....fbfbffffffbfbfbf....
        .........ffffff.........
        ...........fff..........
        ........................
        ........................
        ........................
        ........................
    `, SpriteKind.Player)

    4 - Set ghost controls

    Now, let's make the ghost move left and right. We will add code to control it and put it at the bottom of the screen.

    Add the following code:

    let mySprite = sprites.create(img`
        ........................
        ........................
        ........................
        ........................
        ..........ffff..........
        ........ff1111ff........
        .......fb111111bf.......
        .......f11111111f.......
        ......fd11111111df......
        ......fd11111111df......
        ......fddd1111dddf......
        ......fbdbfddfbdbf......
        ......fcdcf11fcdcf......
        .......fb111111bf.......
        ......fffcdb1bdffff.....
        ....fc111cbfbfc111cf....
        ....f1b1b1ffff1b1b1f....
        ....fbfbffffffbfbfbf....
        .........ffffff.........
        ...........fff..........
        ........................
        ........................
        ........................
        ........................
    `, SpriteKind.Player)
    controller.moveSprite(mySprite, 100, 0)
    mySprite.y = 110
    This adds to the code we had. The new lines let you move the ghost left and right with the controller and set its position near the bottom.

    5 - Create falling pumpkins

    Let's make pumpkins fall from the top. The ghost will catch them for points.

    There is no pumpkin sprite in Makecode Arcade, so we will need to design our own using the paint function for this!

    Add the following code:

    let projectile: Sprite = null
    game.onUpdateInterval(2000, function () {
        projectile = sprites.createProjectileFromSide(img`
            . . . . . . . . . . . . . . . . 
            . . . . . . . . . . . . . . . . 
            . . . f f f f . f f f f f . . . 
            . . f f 4 4 f f f 4 4 4 f f f . 
            . . f 4 4 4 4 4 4 4 4 4 4 4 f . 
            . . f 4 4 4 4 4 4 4 4 4 4 4 f f 
            . f f 4 4 f f 4 4 4 f f 4 4 4 f 
            . f 4 4 4 f f 4 4 4 f f 4 4 4 4 
            . f 4 4 4 f f 4 4 4 f f 4 4 4 4 
            f f 4 4 4 4 4 4 4 4 4 4 4 4 4 4 
            f 4 4 f 4 4 4 4 4 4 4 4 f f 4 f 
            . f 4 f f f 4 4 4 4 4 f f 4 4 f 
            . f 4 4 4 f f f f f f f 4 4 f . 
            . f 4 4 4 4 4 4 4 4 4 4 4 4 f . 
            . f f f f f f f f f f f f f f . 
            . . . . . . . . . . . . . . . . 
            `, 0, 50)
        projectile.x = randint(0, scene.screenWidth())
        projectile.setKind(SpriteKind.Food)
    })

    This code makes a new pumpkin every 2 seconds. It falls down from a random spot at the top and is set as 'Food' kind.


    Unlock the Full Learning Experience

    Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our Digital Skills Curriculum.

    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