This project will help you learn how to move a sprite as you move your mouse around on the Scratch stage.  In this project, we will make a fish move on a mouse pointer and make her meet a crab. When they both meet, they will say “hi” to each other.

1. Create a new Scratch project. Add a backdrop of ‘underwater’ scene from the Scratch library.  Also add a fish and a crab from the library.

fishcrab2.  We want to move fish on mouse pointer and take it to meet the crab. For that we will need to  move the fish toward mouse pointer.  If the fish and the crab are close enough then display “say hello” from both the sprites. Follow the script shown here as you create it on your computer. Add each block one by one. Run it first and check whether it is working as you imagined. Only after that add next block. It will help you learn how each block is working.

Script for fish sprite
Script for fish sprite

if..then block checks the condition, if it is true, runs the block inside.

“broadcast” from “CONTROL” block sends message to all other scripts in the project. This fish is moving and when it touches the crab, we want to send a message to the script blocks for the Crab sprite.

3. Crab sprite will say “hi” when it receives a message with following script.

Script for crab sprite
Script for crab sprite

 

Learn about “broadcast” and  “receive” control blocks. They are very useful.

brodcastbroadcast block sends a message to all the sprites (and the background). This is useful if you want to tell other sprites when to do something.

What do you want them to do when they receive the message? See  receivebrodcast

 

 

 

 

Leave a Reply