One of the coolest features of Scratch is that it can create art! Follow the instructions below to create a fun program that will allow you to draw with your sprite.
Go to Scratch and
create
a new project following the instructions in the projects above.
Click the “Add Extension” button in the bottom-left corner and click “Pen” - this will give you access to the blocks related to drawing. Click the picture to enlarge it
Add the code above to your program - read below to see the purpose of each block!
-
When green flag clicked: The code below this block will run whenever the green flag is clicked
-
Erase all: If the program was previously run, we want to erase everything from the last time and start fresh
-
Forever: The code inside this loop will run forever
-
Set pen (color) to (pick random <1> to <50>): This block sets our pen to a random color. You can adjust the
numbers as you wish; a smaller range will result in a smaller variety of colors.
-
Set pen size to (pick random <1> to <10>): This block sets our pen to a random size.
-
Pen down: This tells the program to put the pen down and start drawing
-
Glide (1) secs to (random position): This block makes our sprite glide to a random spot on the screen. Since our pen is
down, it will draw wherever the sprite goes.
If you let this program run for 20 seconds or so, you’ll start to see some interesting, abstract art appear on the screen!
Source: https://www.create-learn.us