Well, in the website http://www.sciencebuddies.org/science-fair-projects/project_ideas/Games_p023.shtml I can't finish my project. See, at the section "Programming the end of the game", I cannot figure out how the blocks in Table 3 work. I really don't understand most of the blocks in there, and what they do.
Last edited by fgdfgddfg (2009-10-27 18:10:22)
Offline
I told you in the first post:
See, at the section "Programming the end of the game", I cannot figure out how the blocks in Table 3 work. I really don't understand most of the blocks in there, and what they do.
Offline
You are probably having trouble with the "Broadcast" block and the "When I Receive" block.
You use Broadcast when you want one script to start another script, usually (but not always) on a different sprite or the stage. It's a great way to communicate between sprites or the stage.
To use it, drag out a broadcast block and click on the drop-down triangle and pick "New" and you will be prompted for a new message name. You can make up any kind of message name but it's helpful if you pick words that relate to what you are trying to do...like "game over" or "restart game" or "change costume of cat". After you have made a message name, you can then build scripts that will start when the message is "broadcast". To do that, you use the "When I Receive" block. The "Broadcast" and "When I Receive" blocks work as a team...neither one is any good without the other!
Many times you want the script that is Broadcasting to wait until the Receiving script is done running before continuing on...in that case you would use the "Broadcast and Wait" block. If you use the "Broadcast" block (no waiting), the message gets sent but the script that sent it doesn't wait, it just keeps on running.
Broadcast messages can be a little confusing but they are incredibly powerful and well worth learning. They are useful in all kinds of different situations such as:
1. changing the background of the stage when a sprite does something (levels)
2. signaling to sprites to hide or reappear when other sprites do something
3. building a centralized scoring system
4. many, many other things!
Remember that you can always right-click on any block and select Help to learn more about it.
Offline