UnicMinds

Pen Graphics in Scratch Programming - UnicMinds

Pen Graphics in Scratch Programming

To use the Pen blocks in Scratch, please click on the highlighted image, Add extension button.

Pen blocks in Scratch Programming - UnicMinds

Click on the Pen extension to add it.

Pen blocks in Scratch Programming

The Pen section then appears at the bottom of the blocks menu.

Pen blocks in Scratch Programming for Kids

From the Pen section, select the pen down block and add it to the start of your program, like this:

Pen section

On clicking the flag, you can see the output below showing that a line is drawn.

Output

If you can see the lines behind the cat sprite, then the pen is working and one can start making it draw really cool patterns.

To get rid of the cat sprite, the following code is added.

Add a hide block from Looks to the start of the program and it’ll disappear.

Cat Sprite - Pen Section

On clicking the flag, you can see the output below showing that a line is drawn without the cat sprite.

Line Drawn - Cat Sprite - Scratch Programming

Now, one can change the colour of the pen with another block from the Pen section, but the block is a little different to the others you’ve seen. It’s the set pen color to block and looks like this:

Setting Pen Color - Scratch Programming for Kids

If you’ve been clicking on the green flag to test your code, you’ll have noticed that the drawings the pen makes don’t go away.

Add a clear block from the Pen section to the start of your code to take care of that:

Drawing Patterns using Pen Graphics

Drag repeat until block from control section in scratch. This type of loop will do something over and over again, until a True/False condition is met.

The following code is added.

Drawing pattern graphics - Scratch Programming for Kids

Pen will keep moving 50 steps and turn by 15 degrees forever showing the output below:

Pen graphics - Scratch for Kids

The Pen will keep the pattern above without stopping.

We have put the condition “touching edge” condition on repeat until loop. The pen will keep drawing till the pen touches the edge of the screen.

Cat Sprite - Pen Graphics

Output:

Drawing circle using Pen graphics

Changing the code to move 5 steps will create a circle.

What’s happening here is that those 15-degree turns eventually add up to 360 degrees, and so your pen turns in a full circle.

Drawing Circle using Pen Graphics - Scratch Programming
Circle - Scratch Programming - Pen Graphics

Drawing square using Pen graphics

Setting the Pen size of 10 will change the thickness of the line drawn.

Add move 100 steps and turn 90 degrees block in a repeat loop which runs for 4 times as shown in the code below.

Drawing Square using Pen Graphics - Scratch Programming - UnicMinds

Drawing Star using Pen graphics

Add move 100 steps and turn 135 degrees block in a repeat loop which runs for 8 times as shown in the code below.

Drawing Pen Graphics - Scratch Programming - Star

Hope this is useful, thank you.

You may like to read: Debugging for Kids, Common Coding Terms for Kids, & Events in Scratch Programming

Leave a Comment

Your email address will not be published. Required fields are marked *

BOOK A FREE TRIAL