Scratch Game
Beginner
60 mins
Teacher/Student led
180 points
What you need:
Chromebook/Laptop/PC

Penalty Shootout

In this step-by-step lesson, you'll create a penalty shootout game using Scratch. You'll learn how to set up a new project, add a goal backdrop, and incorporate a soccer ball sprite. You'll also code the game mechanics, including choosing your shot, moving the ball, adding a goalkeeper sprite, and detecting if the keeper makes a save or if the ball hits the post. Finally, you'll add the code for scoring a goal.
Learning Goals Learning Outcomes Teacher Notes

Live Class Feed

This is a live feed of the latest activity by your students on this lesson. It will update in real-time as they work on the lesson.
Load previous activity

    1 - Create a new Scratch project

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

    2 - Download and add the goal backdrop

    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/

    3 - Add the Soccer Ball sprite

    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



    4 - Choose your shot

    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]


    5 - Move the ball

    Now let's make the ball move to the spot that you clicked.

    When the ball receives the 'shoot' message. we will make the ball move towards where your mouse pointer is and also shrink the ball so that it looks like it's moving away from you.

    Add the following code to the Soccer Ball sprite.

    when I receive [shoot v] point towards [mouse-pointer v] repeat (30) change size by (-2) move (8) steps end


    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 DigitalSkills.org. 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