Scratch
Intermediate
50 mins
Teacher/Student led
+55 XP
Pupils work on their own device

Coding Sequences and Debugging in Scratch

Pupils build the 'Banana Jump' game in Scratch step by step, writing a working sequence to move sprites toward a goal and then finding and fixing at least one bug along the way.

Teacher Class Feed

Load previous activity

    1 - What We're Building ~5 mins

    Illustration for What we're buildingEvery game and app you use started as a set of step-by-step instructions written by a programmer — and almost none of them worked perfectly the first time. Programmers test their code, spot what went wrong and fix it. That is called debugging.

    Today you are the programmer. We're going to build a game called Banana Jump, where a cat has to leap over falling bananas. Watch the board as each piece is modelled, then build it on your own device and run it to see what happens. When something doesn't work the way you expected — brilliant, that's a bug to hunt down.

    2 - Introduction ~3 mins

    The tool you will use is Scratch, a visual programming language: instead of typing lines of code, you drag coloured blocks out of the palette and snap them together in order, and the sprite does whatever the blocks say, in the order they are stacked.

    Along the way you will make a character move around the stage, make copies of a sprite appear while the game is running, and get the program to notice when two things bump into each other. At the end you will have something you can play and share with your friends. Ready? Let's jump right in!

    3 - Create a New Project ~2 mins

    Start by creating a new Scratch project.

    https://scratch.mit.edu/

    4 - Add the Blue Sky Backdrop ~2 mins

    Add the Blue Sky backdrop from the backdrop library.

    The brown part of this backdrop will be the ground in our game.


    5 - Animating the Cat ~3 mins

    Let's start by positioning the cat down at the bottom left so it appears on the ground. Then we will also make it look like it's running by use a loop (forever block) to change it's costume.

    Add the following code to the Sprite1 sprite:

    when green flag clicked go to x: (-142) y: (-110) forever next costume wait (0.2) seconds end
    Once you have added the code, click on the green flag and the cat should appear at the bottom left and to be running.


    Pupil practice · Investigation Journal
    Module 4 · Technology: Digital Systems and Coding Foundations
    Lesson 26 · Coding Sequences and Debugging in Scratch
    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 123Learn.ie 2017 - 2025. Unauthorised use, copying or distribution is not allowed.

    Scratch is developed by the Lifelong Kindergarten Group at the MIT Media Lab. It is available for free at https://scratch.mit.edu
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more