☰ Contents · Computing

Drawing shapes in Scratch

Lessons 32 · 1 lessons · D.T. Kamaltdinova, D.M. Sayfurov. Informatics and Information Technology, Grade 5 (general editor F.M. Zakirova). “Nashriyot uyi Tasvir”, Tashkent, 2020
32

Drawing shapes in Scratch

Textbook: pp. 103–105
GoalUse Pen blocks so that a sprite leaves a trail and draws squares, triangles and other shapes; work out the turning angle.
New words
the Pen extension: lets a sprite draw lines · pero (Pen)pen down / pen up · pero tushir / ko‘tarcoordinate: x and y that show a point on the stage · koordinatathe angle the sprite turns at each corner · burilish burchagi
Explanation

In programming pictures are drawn with commands, not tools. To draw in Scratch we add the Pen extension through the “add extension” button at the bottom left of the window. The “pen down” block makes the sprite leave a trail and “pen up” stops drawing. “Set pen colour” and “set pen size” change how the line looks, and “erase all” clears the stage. To start from the centre use “go to x: 0 y: 0”. To draw a shape, walking and turning are repeated: a square is “repeat 4: move 80 steps, turn 90 degrees”. A regular triangle is 3 repeats turning 120° each time; a hexagon is 6 repeats turning 60°. Rule: in a regular polygon the turning angle is 360° divided by the number of corners. If you want the sprite itself not to show, use the “hide” block.

Worked examples
A square: green flag → pen down → repeat 4 [move 80 steps, turn 90°]. Angle: 360 : 4 = 90.
A flower pattern: “repeat 36 [draw a square, turn 10°]” – the square is drawn turned 10° each time, and 36 × 10 = 360° completes a round pattern.
Class activity

“Sprite on paper”: following commands on the board, pupils draw on squared paper as the “sprite” (4 times: 5 squares forward, turn right 90°). The result should be a square. Then test in Scratch.

Practice
1
What do “pen down” and “pen up” do?
2
What are the turning angles for a regular triangle and a hexagon?
3
In drawing a regular pentagon, how many degrees is each turn (360 : 5)?
4
Why do we turn 90° four times to draw a square?