This tutorial is based off an excerpt from The Absolute Beginner’s Guide to Coding Using Scratch hard copies and digital copies can be purchased on Amazon
Drawing in Scratch is a lot like drawing with a pen and paper, except in order to draw something in Scratch, you have to tell the computer in which direction to draw the line and how far to draw the line.
By convention, we will use a sprite that looks like a green triangle when drawing as an aid to visibility. You can think of this triangle as a pen. Whichever direction the pen is pointing is the direction the line will be drawn. It is ok to continue using the cat sprite or you can pick your own shape.
The first thing we need to do is draw a straight line. To do this, we will need to put the pen down. Pen down is a command block in the Pen section of the block palette. Then we will need to move the sprite. Move is a command in the Motion section. Set move to 50 steps.

When you click on the flag above the stage, the pen will move across the screen and there will be a line from where the pen started to where the pen ended.

Now we want to draw the side of the rectangle. To change the direction of pen use the turn clockwise block. Set the turn to 90 degrees. This tells the program to rotate the pen 90 degrees to the right. The pen will change direction and will now be facing down.
Next, draw the side if the square by connecting another move 50 steps block. Your program should look like this.

And when your program runs, it should draw two sides of a square like so:

You can see where this is going. Snap together a couple more turn and move command blocks to complete your program.

We manage to create a square! In futures chapters we will learn how to draw triangles and circles

Leave a Reply