Exactly what do you mean by linking? What do you want to happen?
Offline
Hi I already taken a look at your great projects ... but for a beginner .... I don't understand how the "broadcast" and "when I rceive ..." work to enable one set of actions to be linked to another. And I can't find a beginners guide to these tools
Offline
You can find out what different blocks do by right-clicking on them and choosing "help". Also, inside of the support section of the Scratch site, you can look at the different help screens (click here to see descriptions of all the blocks). Below are the screens that are related to the "broadcast" and "when I receive" blocks.
Paulmedwal
And, in case you want it, here is the description for "broadcast and wait"
Last edited by paulmedwal (2007-07-31 14:10:56)
Offline
Basically, Broadcast (message) allows a sprite to "shout" that message to all the other sprites (and the background).
Any of those sprites (or even the same sprite) can be given a "when I recieve" block, which is basically an instruction to listen for a particular shouted message, and act when they hear it.
EG:
Sprite 1 shouts (or rather, Broadcasts) "Start shooting"
Sprite 2 has instructions that say "if somebody shouts "start shooting", move forward 100 (When I recieve...). So when it "hears" sprite 1, it carries out its instructions accordingly.
Offline
rbkc wrote:
... but for a beginner .... I don't understand how the "broadcast" and "when I rceive ..." work to enable one set of actions to be linked to another. And I can't find a beginners guide to these tools
===============================
It took me a long time to figure out the same thing when I started. As Mayhem said, you can link actions using the "Broadcast....Receive" commands.
eg: The Cat in his living room wants to play ball with someone.
In the Cat's script, add the block "Broadcast..." with its blank box.
Click in the blank box and you'll get "new". That means you name the command you want the Cat to send to everyplace in general. So click on "new" and you'll get a little window where you type the name of this "broadcast" command. In this case, you could name it "Play ball".
Now here's the interesting part: any other Sprite and even the Background (Stage) can Receive a broadcast and act on it.
If there's a Dog in your project, click on the Dog sprite and add to his script "When I receive..." Click in the blank box on the command block and you'll see a list of the available broadcasts he could respond to. In this case, click on "Play ball." Then have the dog think "I'd like to play!"
AND, you could have the Stage ALSO receive the broadcast. Click on the Stage and start its script with "When I receive...." and choose "Play ball." Add a command to that script that changes the background from the Cat's living room to a baseball field. So now you'll have the cat standing in the baseball field.
Go back to the Dog and give him commands that let him walk onto the baseball field ready to play!
The first project I posted online was called "Boo!" and it was an experiment with having a wizard broadcast commands and have other characters, and the background, respond to them. If you'd like to look at the project and the scripts, it's at:
http://scratch.mit.edu/projects/Larry828/11086.
Best of luck having your sprites interact with each other!!
Offline