Skip to content
Transcript

In this add-on, you will make it possible to change the paint color when the user presses a key by adding a keypress event.

This type of event makes a specific action occur in your program when a user presses a certain key on the keyboard, such as the space bar, a number, or a letter.

Find the when space key pressed blocked under Events and drag it out.

You can set the keypress to any key.

This example uses the right arrow.

Next, from the Looks menu, select a change color effect by 25 block.

That's it!

Now you can press the right arrow key to change the paint color.

Computer scientists use their imaginations in their projects all the time!

They also explore new and different ideas.

Check out some of the other change effect options available in Scratch that you can add to your code.

Using the same concepts you just saw in this video, you could make keypress events that control just about any part of your project, including the brightness and size.

Computer science doesn't have many limits.

If you can think of it, you can create it!

Finally, add instructions letting the user know that pressing whatever key you chose will change the color of the brush.

Now it's your turn.

Use a keypress event and the change color effect by 25 block to change the paint color when the user presses a key.

Experiment with more keypress events and change effect by blocks to create more cool art effects in your project.

Finally, add instructions to your project.

Choose an Add-On

Picture Guessing Game

Turn your Graffiti project into a guessing game with a timer!

Paint in All Colors

Let the user change the paint color.

Tag the Town

Give the user different backdrop choices.

Paint Remover

Create a button to clear the screen.

Instructions

  1. Choose an Add-On, and click "watch" to learn how to build it.
  2. Once you finish one Add-On, try another one below the video!