Welcome to our exciting lesson, Rainbow Paintbrush! In this lesson, we are going to create a fun drawing tool that changes colours as you draw.
We will use Scratch's pen blocks, colour changing, and mouse movement features. By the end of this lesson, you will have your own rainbow paintbrush that follows your mouse pointer and changes colour as it moves. Let's get started!
Open the Scratch website in a new tab and create a new project. Delete the cat sprite from the project.
We need to add a sprite that we will use for out pen.
Add the Ball sprite from the sprite library and give it this code to shrink it smaller.
when green flag clicked
set size to (30) %To add a sprite from the sprite library follow these steps:
You can use search box or the filter links (Animals, People, Fantasy etc) to locate your sprite.
Now, we want our pen (the ball sprite) to follow our mouse pointer. This will allow us to control where we draw on the screen.
To do this, add the following code to your ball sprite:
when green flag clicked
set size to (30) %
forever
go to [mouse-pointer v]
endYou're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.