Head office, Rana Pratap Bagh, Delhi011 2721 1512+91 97116 99511

Science project idea

Scratch animated story of a monsoon day using broadcasts

Broadcast messages let sprites talk to each other, so scenes happen in order without anyone clicking. It shows how separate scripts cooperate in one program.

What it shows

Broadcast messages let sprites talk to each other, so scenes happen in order without anyone clicking. It shows how separate scripts cooperate in one program.

The science

A broadcast is a signal sent to every sprite. Any sprite with a when I receive block for that message starts its script at once. This lets you split a story into scenes and keep each sprite’s script short. The same idea is used in real programs where one part tells other parts that an event has happened.

Materials

Cost: free. Many items come from home or from waste; spare parts such as LEDs, motors and wire are in the store.

  • A computer, laptop or phone with a browser (free)
  • Scratch 3 in the browser at scratch.mit.edu (free, no sign-in needed to code)
  • Backdrops and sprites from the Scratch library: a child, a cloud, rain and a rainbow
  • A notebook and a pencil

Safety

This project uses safe, everyday materials. Still, read the rules below with a parent before you start.

Never use mains electricity: power models with cells, batteries or a low-voltage adapter. Sharp and hot tools, flames and lab chemicals need an adult or your teacher beside you. Keep magnets, button cells and small parts away from young children, and wash your hands after making.

All the safety rules

Step by step

8 steps. Do them in order, and test each part before you go on to the next. Write what you notice in a notebook as you go.

  1. Choose a sunny backdrop and name a second backdrop rainy by duplicating it and painting it grey, then name a third one rainbow.

  2. Add a child sprite and a cloud sprite, and write the story on paper in three scenes: sunny play, rain starts, rainbow.

  3. On the child: when green flag clicked, switch backdrop to sunny, say Such a hot day! for 2 seconds, then broadcast rain.

  4. On the cloud: when I receive rain, show, glide 2 secs to x: 0 y: 140, then switch backdrop to rainy.

  5. Add a Rain sprite: when I receive rain, repeat 30 with change y by -10, so drops fall; use hide at the start and show when received.

  6. On the child add: when I receive rain, say Bring the umbrella! for 2 seconds, wait 3 seconds, then broadcast rainbow.

  7. Make a when I receive rainbow script that switches backdrop to rainbow and plays a sound with start sound.

  8. Press the green flag and watch all three scenes play; then record a voice for each speech with the Sounds tab.

What you should see

The story plays by itself: a sunny scene, then clouds and falling rain, then a rainbow with a sound, each scene starting when a broadcast is received.

Viva questions

A teacher or a judge will ask how it works. Try to answer each question before you open it, then compare.

1What does broadcast do?

It sends a message that every sprite can listen for.

2Which block starts a script on a message?

The when I receive block.

3Why not put everything in one sprite?

Separate short scripts are easier to read, test and fix.

4How does the story order stay correct?

Each scene ends by broadcasting the message that starts the next one.

Free ebook: Viva Questions for Science Projects

Take it further

Add a second ending chosen by pressing a key, using two different broadcasts, so the story can finish in two ways.

Change one thing, measure what happens, and add a table or chart of your readings: that is what turns a model into your own investigation.

Free ebooks for this project

WhatsApp us