Scratch
Beginner
40 mins
Teacher/Student led
+160 XP

Loops in Scratch

Students use PRIMM to build a Pattern Creator in Scratch, replacing repeated move and turn blocks with a loop and explaining why a loop is the better approach.

Teacher Class Feed

Load previous activity

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

    Illustration for Start: what we're buildingToday you are coding in Scratch. You will build a Pattern Creator step by step at your device.

    You can already make a sprite move and turn. Today you will put those actions inside a loop so the pen draws circles, lines and spirals without copying the same blocks over and over.

    Before you run anything, think: what might happen if the sprite keeps moving and turning a little bit each time?

    2 - Introduction to Pattern Creation ~2 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!


    3 - 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


    4 - 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


    5 - Add the Pen Extension ~3 mins

    To draw the patterns we will be using the Pen blocks so add the Pen Extension to your project.

    Once you've added the Pen Extension add the following new code blocks to the Ball sprite underneath the hide block.

    when green flag clicked go to x (0) y (0) hide // add new code under here pen up // start with the pen up erase all // erase drawings from the last time set pen color to [#3438df] // choose a color pen down // put the pen down


    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