Scratch
Beginner
50 mins
Teacher/Student led
+170 XP

Loops in Scratch

Students build Pattern Creator in Scratch, using the Pen blocks and a loop with variables to draw spirals and patterns, then predict, run, and debug their code. A PRIMM-structured introduction to loops, variables and the pen tool.

Teacher Class Feed

Load previous activity

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

    Quick recap: last time we worked in Scratch — who can tell me what a loop does to a set of instructions?

    Today we're building Pattern Creator at our devices. We'll teach a hidden sprite to drag a pen around the screen, then use a loop and a few variables to turn a single line into colourful spirals. First we predict, then we build, run and fix.

    2 - Predict Before You Run ~10 mins

    Before anyone clicks the green flag: look at what we're about to build. Commit to a prediction — when this program runs, what will happen on the stage? Will you see the sprite, or just what it draws? Will it draw once or keep going?

    Say your prediction to your partner so we can check it later.

    3 - Introduction to Pattern Creation ~3 mins

    Welcome to our exciting lesson on Pattern Creation! In this lesson, you will learn how to create cool patterns using Scratch. You will learn how to code the pen tool and use variables to make your patterns more interesting. By the end of this lesson, you will be able to create your own unique patterns. So, let's get started!


    4 - Create a New Scratch Project ~2 mins

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

    scratch.mit.edu/projects/editor


    5 - Add the Ball Sprite ~2 mins

    We are going to use the Pen blocks to create patterns but first we'll need to add a sprite that will do the drawing. It doesn't really matter which sprite we use as we are going to hide it.

    Add the Ball sprite from the sprite library and then give it the following code.

    when green flag clicked go to x (0) y (0) // we want to start it in the center hide


    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