Pen graphics in Scratch programming

To use the pen blocks in Scratch, click the highlighted image “Add Extension” button.
Click on the pen extension to add it.
The pen section will then appear at the bottom of the block menu.
From the Pen section, select the pen block and add it to the beginning of the program, as shown below:
After clicking on the flag, you can see the output below showing that a line has been drawn.
If you can see the lines behind the cat sprite, that means the pen is working and you can start letting it draw really cool patterns.
To get rid of the cat sprite, add the following code.
Add a hidden block in Looks to the beginning of the program and it will disappear.
After clicking on the flag, you can see the output below, showing that a line is drawn without the cat sprite.
You can now change the color of your pen using another section in the Pens section, but this section is a little different than others you’ve seen. This is the set pen color to be blocked, as shown below:
If you keep clicking on the green flag to test your code, you’ll notice that the pen drawing doesn’t disappear.
Add a clear block from the Pen section to the beginning of the code to handle this:
Draw patterns using pen graphics
Drag the repeat from the control section to the block from the beginning. This type of loop performs certain operations over and over again until a True/False condition is met.
Add the following code.
The Pen will continue moving 50 steps and rotating 15 degrees forever, displaying the following output:
The pen will keep the pattern on it.
We put the “touch edge” condition on the repeat until loop. The pen will continue drawing until it touches the edge of the screen.
Output:
Draw circles using pen graphics
Changing the code to move 5 steps will create a circle.
What’s happening here is that these 15 degrees of rotation end up adding up to 360 degrees, so your pen makes a full rotation.
Draw a square using pen graphics
Setting the pen size to 10 will change the thickness of the drawn lines.
Add a block that moves 100 steps and rotates 90 degrees in a repeating loop that runs 4 times, as shown in the code below.
Draw stars using pen graphics
Add a block that moves 100 steps and rotates 135 degrees in a repeating loop that runs 8 times, as shown in the code below.
Hope this helps, thanks.
You might like to read: Debugging for Kids, Common Coding Terms for Kids, and Events in Scratch Programming