O'Reilly logo

Raspberry Pi Projects for Kids - Second Edition by Daniel Bates

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Interactive animation

We now have two different animated sprites, each doing their own thing. One of the special features of Scratch is that it makes interactive animation simple—we can program a sprite to react to you!

Create a new sprite in the same way as you did before using the Choose new sprite from file button. For this animation, we're going to have a simple conversation with the user, so choose an image of something that can talk. Find a good position and size for the new sprite, then build the following script in its script area:

Interactive animation

There are a few new code blocks here. Let's go through them one by one:

  • ask and wait: This gives the sprite a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required