Please update your browser
Your browser version is not supported by this site. CS First may not work properly.
In this add-on, you will make the painter’s palette on the stage clickable.
This will allow the artist to select a color to draw with.
First, select the pencil sprite and the "pen" menu.
There are three colors for the artist to choose from, so drag out three "set pen color to"
To set the color value in these blocks, click the color swatch, move the mouse over the
color you would like to select, and click.
Make the color value in each block match one of the colored dots in the painter’s palette.
To test a block, click the flag, then click one of the “set pen color” blocks, and
Add an event to tell the computer when these blocks should run.
These blocks will run when the dot sprites are clicked.
To make one sprite affect another sprite, broadcast a message between them.
Click "dot 1," and drag out a "when this sprite clicked block."
To make the dot 1 sprite broadcast a message when clicked, drag out a "broadcast" block,
and attach it to the "when this sprite clicked" event.
Click the dropdown, and create a new message.
Name it the color of the dot, which in this example is "blue."
Then, click the pencil sprite, add a "when I receive" block, and change the message to
Try it out.
Click dot 1, and start drawing.
When you click the dot, it broadcasts the message "blue," the pencil receives the message,
and it changes the pen color to blue.
Next, make the other dot sprites broadcast messages as well.
This example fast forwards through these steps, as they are the same ones you used to program
the first dot.
Once you have made all three colors on the palette clickable, try it out!
Then, play the game with a friend.
It’s fun to see how this new feature makes the game more colorful!
Now it’s your turn: Select the pencil, and add three "set pen
Set the color in each block to one of the dot colors.
For each dot, use a "when this sprite clicked" and a "broadcast" block.
Create a new broadcast message for each color.
Select the pencil again, and add three "when I receive blocks" with the correct message