Game Development Reference
In-Depth Information
Sending a message
Someimes, you don't want a script to start working right from the start of the game.
For such cases, you can trigger a script by sending a message, instead of just staring it when
the <green lag> buton is pressed. This way, the script will stay dormant and inacive unil it
receives the right message. You can actually compare this to someone yelling a certain order
that the script has to respond to. In this secion, we will postpone the appearance of the
boss monster unil certain game condiions are met.
Prepare for lift off
Messages are part of the Events category. Let's go there and see what we have to work with.
Near the botom of the list are three message blocks; one staring block (with the curved
top) that can receive a message, and two broadcasters immediately below that can shout a
message to all the scripts.
Engage thrusters
We will use these messages to difereniate between the two states of the game. The player
can either fight waves of enemies or the boss. Depending on the case, certain scripts have to
be made acive/inacive:
1. We go to the Stage script to set up the broadcasts.
2.
First, we throw away the stop <all> block. This is just a temporary means of
ending the game.
3.
In its place, we will use the broadcast () block.
 
Search WWH ::




Custom Search