Draw shapes with the pen
Medium · Teach the sprite to draw a square, a star and a colorful flower.
Interactive tutorial: the editor checks each step by itself.
- Add the "Pen" extension.
- Choose a sprite and drag "when flag clicked".
- In the Pen category, snap "erase all" and then "pen down".
- In Control, snap "repeat 10" and change 10 to 4.
- Inside the "repeat", put "move 100 steps" and "turn right 90 degrees".
- Click the flag: a square!
- Now change 4 to 5 times and 90 to 144 degrees: a star!
- Challenge: put "set pen color to hue" (Pen) with a random number inside the repeat so each side has a color. (challenge)
The blocks of the finished program
• evt_bandeira • can_limpar • can_abaixar • ctl_repetir [VEZES: 5] • can_matiz [VALOR: (op_aleatorio)] • mov_mover [PASSOS: 100] • mov_girar_dir [GRAUS: 144]