Skip main navigation

Repetition in Art

In this video you'll learn how to use repetition to draw simple shapes as well as more complex patterns.
1.8
Last week, you were introduced to Scratch. And one of the activities was using the pen features to draw shapes on the stage. In this video, I’m going to show you how you can use repetition to draw more interesting shapes and drawings. One of the things you drew last session was a triangle. So I’m going to recreate that. And we’ll draw it when the sprite is clicked. And then I need to get the pen extensions. So let’s add those blocks in. And now I can use a pen down block at the start. And then to draw a triangle, I’m going to need some move blocks and some turn blocks.
40.4
So I know I’m going to need to move and turn three times, once for each side of the triangle.
51.5
And I remember from last week that a good length was 50 steps for each side. And then I had to turn 120 degrees around the outside of each angle of the triangle, because that’s the value of the exterior angle. So let’s update each of those blocks. So each time, we’re moving 50 steps and then turning 120 degrees.
82.5
And then when I click the pencil, you’ll see that it draws the triangle. Now, that’s one way of drawing a triangle. But I’m going to show you how to use repetition to draw the shape more efficiently. The repeat block in Scratch is in the Control section. So I’m going to drag that repeat block into my coding area. And what I want to do is I still want to move and turn three times. But instead of using that code over and over again, I can put these two blocks inside the repeat block and give the instruction to repeat them three times. So now I don’t need these blocks, so I’ll just drag them back over into this area to delete them.
132.2
You’ll notice that the pen down block is outside of the repeat block, because I only want that to happen once before drawing the three sides of the triangle. So let me bring in an erase all block so that we can clear the stage. And then let’s click on the pencil, and you’ll see that it draws the triangle exactly as it did before. Now I can draw some different shapes by repurposing the same code. So I could draw a square by repeating four times and turning 90 degrees each time.
174.5
Let’s try that out.
178.1
That’s great. Or I could draw an octagon by repeating the code eight times and just turning 45 degrees each time.
193.7
And you’ll see, I only need to change these two numbers to draw lots of different shapes. And also, by using this repetition block, I can repurpose the code to make bigger shapes too. So what I need to do for that is to change this number. So I could choose to draw each side of the octagon so that it’s 100 steps. Let’s clear and try that one out. Oops. OK, let’s clear and try that one again. That’s better. Now, I’m not exactly sure what I want to draw next, so the next thing I’m going to do is just to tinker. For example, I don’t know what this stamp block does.
239.9
So I’m going to drag it into my code, and I’m just going to see what it does. OK. So it stamps a copy of the sprite just before it moves and turns at the beginning of every side. I’m going to change the numbers as well. So I’m just going to choose a repeat number of, let’s say, 40. And I’m going to decide to turn 130 degrees each time. And I think I’m going to take that stamp block out, because it doesn’t really add to the drawing. And I’m not really sure what I’m doing here. I’m just tinkering with the code, making small changes, and then I’ll click the pencil to see what happens. OK, so that’s looking nice.
287.9
I could make some more changes as well. So by looking at the pen blocks, I could decide that I want to change the pen size. So I could say, let’s change the pen size by 3.
306.8
And I’ve also noticed there’s a change pen colour block. So I’m going to put that inside the loop so that each side of the shape is going to be drawn in a different colour.
322.5
And that draws a very nice multicoloured shape. But what you’ll notice is that the pen thickness is getting thicker each time. So what I think I will do is I will swap out that change pen size block for a set pen size block. And I’ll put that at the start and set the pen size to 3. And now if I erase everything and try again, you’ll see that it stays the same size. I’ll just run it full screen as well so you can see that the pen size doesn’t actually change size this time.
364
And one final thing you’ll notice is that the pencil doesn’t actually end up facing in the right direction. And I’d quite like that to happen. So I’m going to add some code in to reset the stage and the sprites when I press the Spacebar. I’m going to make sure that the pen is pointing over to the right-hand side. So it’s going to point in direction 90. And as you can see, that’s pointing towards the right. I’m also going to make the pencil sprite go back to the centre of the stage when I press the Spacebar. And if you’ll remember from week 1, the coordinates for the centre of the stage are x, 0, and y, 0.
408.1
So let’s pop those values in here. And then, finally, from last week, you’ll remember that the order of these instructions is very important too. So let’s add the erase all block back in right at the end of this script. So now I can click the Spacebar to clear the stage. And I can click the pencil to draw a shape. And there’s my drawing. Now you’re going to have a go to see what you can create.

In this section, you’ll learn how to use repetition to draw simple shapes as well as more complex patterns.

This video shows how this can be done in Scratch, and demonstrates some simple examples.

This article is from the free online

Teaching Programming in Primary Schools

Created by
FutureLearn - Learning For Life

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

Learn more about how FutureLearn is transforming access to education