concept message in category scratch

appears as: messages, message, message
Hello Scratch!: Learn to program by making arcade games

This is an excerpt from Manning's book Hello Scratch!: Learn to program by making arcade games.

Broadcasting messages

Have you ever been in a relay race where you are passed a baton and begin to run? Scratch has a way of sending messages between two unrelated scripts so one script can pass a virtual baton to the other script and tell it to run. For instance, a broadcasting script could be used to track the number of tries left in the variable Lives. When it reaches zero, it sends the second script a message to flash the Game Over sprite on the screen, as shown in figure 3.32.

Figure 3.32. You can use broadcasting to send a Game Over message when the player uses up all of the lives.
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest