Scratch
Beginner
40 mins
Teacher/Student led
+160 XP

Variables and Input in Scratch

Students build a Paddle Ball game in Scratch, using a speed variable with assignment and arithmetic, and mouse input to control the paddle.

Teacher Class Feed

Load previous activity

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

    Illustration for Start: what we're buildingYou can already make sprites move and respond in Scratch. Today you will build a Paddle Ball game step by step.

    Before you run anything new, think: if the ball's step size is stored in a variable called speed, what might happen when that value goes up after each hit?

    You will predict, build, run, and fix as you go, and use mouse input so you can control the paddle.

    2 - The Plan: Four Parts to Build ~2 mins

    Paddle Ball has four parts. You will build them in this order, and test each one before you add the next:

    1. A ball that bounces around the stage on its own.
    2. A speed value stored in a variable, so the ball can get faster later.
    3. A paddle you control with the mouse, that the ball bounces off.
    4. A game over line that stops the game when the ball gets past you.

    Splitting a build into parts like this is called decomposition. It is also what makes bugs findable: when something breaks, you already know which part to look at.


    3 - Create a New Scratch Project ~2 mins

    Create a new Scratch project and delete the cat sprite that's added by default.


    4 - Add the Paddle Sprite ~2 mins

    Add the sprite called 'Paddle' from the sprite library.

    Drag the paddle to near the bottom of the stage area (by holding down the left mouse button and moving your mouse). Make sure to leave some space between the bottom of the stage area and the paddle (this is important later on as we'll be putting something there).



    5 - Add the Ball Sprite ~2 mins

    Add the sprite called Soccer Ball from the sprite library. This is the ball the paddle will bounce.


    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