Home > Books > Scratch Programming in Easy Steps > 10 block demos > Simple broadcasts example

How Scratch broadcasts work, and how to teach them

Sean McManus, author of Scratch Programming in Easy Steps and Cool Scratch Projects in Easy Steps, shows you how to demonstrate broadcasts in Scratch

I am a Code Club volunteer, and before starting the third Code Club project (fireworks), I created a simple demonstration to show my club how broadcasts work in Scratch. I talked through it at the start of the session, and kept it as simple as possible, and the club members all had a go at making it before beginning the main project.

Teachers, Code Club volunteers, and Scratch students might also find it useful.

What are broadcasts in Scratch?

  • You can't make one sprite move another sprite
  • But you can make one sprite tell another one it's time to do something, and then that sprite can move itself
  • To do that, you send a message using a broadcast
  • Broadcasts are messages that one sprite sends to another

A simple demonstration of broadcasts

  1. Start a new project
  2. In Scratch 2.0, import the sprite Bat1
  3. If you're using Scratch 1.4, add sprite bat1-a, and add the costume bat1-b
  4. Add this script to the cat sprite:

    When this sprite clicked / broadcast Fly

  5. Add this script to the bat sprite:

    When I receive fly / move 10 steps / next costume

  6. Run the program. When you click the cat, it sends an invisible message to the bat, the bat receives the message and flaps its wings and flies.

Try the example program

Click the cat to make the bat fly.

What else should I know about broadcasts?

  • Broadcasts are sent to all sprites at the same time, but they don't all have to respond
  • You can react to a broadcast from the same sprite that sent it
  • So you need to take care that you put your 'reaction' scripts on the right sprite and don't do this by mistake

Demo card for sharing

Here's a card that encapsulates all this. Feel free to share the image below on Twitter, Facebook or your other social networks

Card demonstrating broadcasts using the code explained above

Find out more...

Find more 10 block Scratch demos here. For more information on my Scratch books and more bonus content, visit the Scratch Programming in Easy Steps and Cool Scratch Projects in Easy Steps.

Credits

© Sean McManus. All rights reserved.

Visit www.sean.co.uk for free chapters from Sean's coding books (including Mission Python, Scratch Programming in Easy Steps and Coder Academy) and more!

Discover my latest books and music

Artificial: album cover shows a steampunk heart

Artificial

What happens beyond AI when the machines become emotional? Discover my new album of electronic music here.

Mission Python book

Mission Python

Code a space adventure game in this Python programming book published by No Starch Press.

Coder Academy book

Coder Academy

Learn to make games and other programs in Scratch, and make a web page in HTML. Highly interactive book for 7-10 year olds.

Cool Scratch Projects in Easy Steps book

Cool Scratch Projects in Easy Steps

Discover how to make 3D games, create mazes, build a drum machine, make a game with cartoon animals and more!

Walking astronaut from Mission Python book Top | Search | Help | Privacy | Access Keys | Contact me
Home | Blog | Copywriting Services | Books | Free book chapters | Articles | Music | Photos | Games | Shop | About