Scratch
Intermediate
50 mins
Teacher/Student led
+130 XP

Scratch: Loops and Events

Pupils build a Penalty Shootout game in Scratch, using loops to move the ball and events to trigger the shot and the goalkeeper's dive, then debug and record a fix.

Teacher Class Feed

Load previous activity

    1 - What We're Building ~5 mins

    Illustration for What we're buildingToday you are the programmer! People who make games write code that tells sprites what to do and when to do it. We're going to build a Penalty Shootout game in Scratch — you'll take a shot, and a goalkeeper will try to save it. Watch the board first as each piece is modelled, then build it yourself and run it to see what happens. Games like this use two big ideas real programmers use every day: loops to repeat an action, and events to decide when something starts.

    2 - Create a New Scratch Project ~2 mins

    Go to the Scratch website and create a new Scratch project. You can delete the cat sprite.

    3 - Download and Add the Goal Backdrop ~6 mins

    Included with this step is a picture of a soccer goal, download this picture onto your computer and then upload it as a new backdrop in your project.


    If for some reason you can't save the background image to your computer and upload it, you can just use this starter project which already has the backdrop added to it. https://scratch.mit.edu/projects/573459765/editor/

    4 - Add the Soccer Ball Sprite ~2 mins

    Add the Soccer Ball sprite from the sprite library and give it the following code to set it up for the start of the game.

    when green flag clicked set size to (100) % go to x (0) y (-130) // the bottom middle of the stage area



    5 - Choose Your Shot ~2 mins

    To take a penalty shot you will click with your mouse the spot in the goal where you want to ball to go. This means that you will be clicking the backdrop so add the following code to the backdrop to broadcast a message.

    when stage clicked broadcast [shoot v]


    Pupil practice · Investigation Journal
    Module 4 · Technology: Digital Systems and Coding Foundations
    Lesson 27 · Scratch: Loops and Events
    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.

    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