SCRATCH GOLD II
SCRATCH GOLD I
2 of 3

5.02 Make a pencil

Start by making a pencil that you can use to draw on the Stage.

Open the ‘Paint box’ Scratch starter project.

Online: open the starter project at paint-box-on

In the starter project, you should see pencil and eraser sprites:

screenshot

Add the Pen extension to your project.

To use the Pen blocks in Scratch, you need add the Pen extension.

  • Click on the Add extension button in the bottom left-hand corner.
add extension button highlighted
  • Click on the Pen extension to add it.
pen extension highlighted
  • The Pen section then appears at the bottom of the blocks menu.
pen extension blocks

Add some code to the pencil sprite to make the sprite follow the mouse pointer forever so that you can draw:

pencil

Click the flag and then move the mouse pointer around the Stage to test whether your code works.

Next, make your pencil only draw if the mouse button is being clicked.

Add this code to your pencil sprite:

pencil

Test your code again. This time, move the pencil around the Stage and hold down the mouse button. Can you draw with your pencil?

screenshot

If the line your pencil draw looks like it is coming from the pencil’s middle, you need to change your pencil sprite’s so the tip is the sprite’s centre.

Click on the pencil sprite, and then click on the Costumes tab.

Move the costume’s so the tip of the pencil is just above the centre.

Costume center

Now move the pencil around on the Stage and draw. The pencil should now draw a line from its tip.

×
×

Cart