This Scratch tutorial uses the broadcast and receive code blocks. We will have 2 sprites on the stage with the one sprite reacting to the other when they bump into each other.
In this tutorial:
Required knowledge:
Scratch Cat
In this program, we have two sprites: Scratch Cat and a Pufferfish. Using almost exactly the final code from the Sensing in Scratch tutorial, we start with the code below for the Scratch Cat:

Broadcast
The code from step 1 (for Scratch Cat) needs one block added, the broadcast block.

Pufferfish
The Pufferfish sits in the path of Scratch Cat. Like any pufferfish, this Pufferfish will puff up angrily when something bumps into it.

- The Pufferfish has a total of 4 costumes
- Use the change size by block in combination with the switch costume block to make Pufferfish swell as well as huff-and-puff
- Add the above to a loop
Receive

When Scratch Cat touches Pufferfish, he broadcasts a message that can be received by any other sprite in the program. All we need to do is add the when I receive block to the Pufferfish sprite code.
Finishing touches

- Once the loop has puffed our Pufferfish up, use the set size block to return it to 100% of its original size.
- Add a little change of expression — once the Pufferfish has calmed down he gives a little wink.
- As the Pufferfish program is finished, add a stop block and set it to this script.
Motion
Looks
Sound
Events
Control
Sensing
Operators
Variables
My Blocks