🎨 Phase 2 · Animation Skills 🟡 Intermediate MODULE 07

Draw with Pen

⏱️ 35 min
📖 Theory + Build
🧩 5 Quiz Questions
🏗️ 1 Challenge
Your progress in Phase 275%
🎯 What you'll learn: The Scratch Pen extension — a special set of blocks that lets your sprites draw on the stage! We'll learn all the pen blocks, the secret maths behind shapes, and build a Robot Artist that draws shapes automatically!

What is the Pen Extension?

The Pen extension gives your sprites a virtual pen. When the pen is down, moving the sprite draws a line on the stage. When the pen is up, moving the sprite doesn't draw anything. Think of it like lifting a pencil off paper!

1
⬆️
Open Extensions
Click the blue jigsaw puzzle icon in the very bottom-left of the Scratch editor
2
🖊️
Find "Pen"
Scroll down to the "Pen" extension and click it. A new green Pen category appears in your blocks!
3
Start Drawing!
You'll now see pen blocks in the Pen category — green coloured blocks in your toolbox
💡
Pen extension is only for certain projects
The Pen is not in the default Scratch blocks — you must add it via Extensions each time you start a new project. But once added, it saves with your project!

All Pen Blocks

Here are all the pen blocks you need to know. They're green in Scratch!

pen down
Puts the pen on the stage. Moving the sprite now draws a line. Like pressing a pencil to paper!
pen up
Lifts the pen off the stage. Moving the sprite now moves without drawing.
erase all
Clears all pen marks from the stage. Use at the start of your project to clear old drawings!
set pen color to [colour]
Changes the pen colour. Click the colour swatch to pick any colour you want!
set pen size to (3)
Sets how thick the pen line is. 1 is thin, 10 is thick, 50 is very chunky!
change pen color by (10)
Slowly shifts the pen colour — great for rainbow drawings where colour changes automatically as you draw!

The Secret to Drawing Any Shape

Here's an amazing maths trick: to draw a regular shape, you need the sprite to turn a total of 360 degrees. Divide 360 by the number of sides to get how much to turn each time!

Triangle
360 ÷ 3 = 120°
Repeat 3 · Turn 120°
Square
360 ÷ 4 = 90°
Repeat 4 · Turn 90°
Pentagon
360 ÷ 5 = 72°
Repeat 5 · Turn 72°
Hexagon
360 ÷ 6 = 60°
Repeat 6 · Turn 60°
Circle
360 ÷ 36 = 10°
Repeat 36 · Turn 10° · Move 5
Star
Turn 144° (5-pt)
Repeat 5 · Turn 144°
HOW A PENTAGON IS DRAWN — STEP BY STEP
Total sides:5 sides
Turn angle:360 ÷ 5 = 72°
Step 1:pen down → move 100 → turn 72°
Step 2:move 100 → turn 72° (again)
Steps 3-5:Same! → back where we started
Drawing a Pentagon
SCRATCH BLOCKS
when 🚩 clicked
erase all
go to x:(0) y:(0)
point in direction (90)
set pen color to [orange]
set pen size to (3)
pen down

repeat (5)          ← 5 sides
  move (100) steps
  turn ↻ (72) degrees  ← 360÷5=72

pen up

Build: Robot Artist 🤖🎨

Now let's build a Robot Artist that draws a beautiful spiral of colourful shapes! It uses everything we've learned — pen, loops, and motion all working together.

1
Set up
Add the Pen extension. Use the Arrow sprite (small, so it's easy to see the drawing). Add a dark backdrop — "Black" or "Stars" makes colours pop!
2
Clear and position
Start with erase all, then pen up, then go to x:0 y:0, then point in direction 0. Set pen size to 2.
3
Outer forever loop
Add a forever loop. Inside, we'll draw a square that slowly grows with each loop — creating a beautiful spiral square!
4
Add the square inside
Inside forever: repeat 4move (size) stepsturn 90 degrees. Then after the repeat: change size by 2 and turn 5 degrees.
5
Add rainbow colour
Before the repeat 4, add change pen color by 5. Now each square will be a slightly different colour, creating a beautiful rainbow spiral!
Robot Artist — Rainbow Spiral
SCRATCH BLOCKS
when 🚩 clicked
erase all
pen up
go to x:(0) y:(0)
point in direction (0)
set pen size to (2)
set [size] to (10)
pen down

repeat (50)          ← draw 50 growing squares
  change pen color by (7)  ← rainbow colours
  repeat (4)         ← draw one square
    move (size) steps
    turn ↻ (90) degrees
  change [size] by (3)  ← grow each square
  turn ↻ (5) degrees    ← rotate slightly

pen up
🎨
Experiment with the numbers!
The magic is in changing the numbers: try turning 7 degrees instead of 5 for a tighter spiral, or change pen size to 3 for thicker lines, or set the outer loop to 100 for a bigger pattern. Each small change makes a completely different artwork!
🧩 Knowledge Check — Lesson 7
5 pen questions. Test your artistic coding!
1. Where do you find the Pen blocks in Scratch?
2. What is the difference between "pen down" and "pen up"?
3. To draw a triangle, the sprite must turn 360° total. How many degrees does it turn each step?
4. What does the "erase all" block do?
5. What does "change pen color by 10" do in a drawing loop?
💪
Scratch Challenge — Lesson 7
Pen artistry · Intermediate Level
Challenge: Spirograph! 🌀

Create a spirograph pattern (like the old drawing toy!) using nested loops and pen.

Requirements:
1. Draw a circle using repeat 36move 5turn 10
2. Wrap that in an outer repeat 36 that turns the whole thing by 10° each time
3. Change pen colour after each circle
4. Use different pen sizes for different circles
5. The pattern should form a complete spirograph when done — clear the screen at the start!
💡 Show hints if you're stuck
  • Structure: erase all → pen down → repeat 36 (outer) → turn 10 → repeat 36 (inner) → move 5 → turn 10
  • Change colour: add change pen color by 10 in the outer loop
  • Try pen size 1 for fine lines — thick lines will fill up quickly
  • Use a black backdrop to make colours pop!
Finished this lesson?
Mark it complete to track your progress.
🎨

Lesson 7 Complete!

You're an artist-coder! One more lesson in Phase 2 — make things interactive with keyboard and mouse!

Module 07 of 16Phase 2 — Animation Skills