
So far, most of our Scratch programs have had us follow a single sprite. This is great for making videos and animations, and we even made some basic interactive games using input, loops, and if/else statements. That’s a lot, really!
But think of your favorite games. There’s probably a lot of characters, and they interact in many ways: they have conversations, buy and sell items, or compete with one another.
In games, like in life, you need to communicate. Sprites in Scratch communicate with the Broadcast command.
Look at this demo. The program starts in a familiar way: when the green flag is clicked, the dragon says ROAR for 2 seconds. That’s great, but it doesn’t get much of a reaction… until we add the broadcast command. We’re calling our broadcast signal “roar” and seeing who picks it up.
If you click on the princess sprite, you’ll see that she has some code of her own. Her code starts when she receives a broadcast called roar, and has her saying “A DRAGON!” for 2 seconds.
- Intro to Scratch Programming
- Intro to Scratch Programming: If/Else and Variables
- Intro to Scratch Programming: Loops
- Advanced Scratch: Broadcasts
- Advanced Scratch: Custom Blocks and Extensions (Make your own music!)
- Resources for Young Coders