- Students use a loop to repeat move and turn actions, compare that approach with copying blocks, and practise debugging when the pattern does not match what they expected.
- Students use a loop to repeat move and turn actions, compare that approach with copying blocks, and practise debugging when the pattern does not match what they expected.
Teacher-led from the board — pupils need no device
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.
Today 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
DigitalSkills.org · 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.