Game Development Reference
In-Depth Information
36.
//Someone has to take care about that
37.
SendMessage("OnAllLivesLost",
38.
SendMessageOp-
tions.DontRequireReceiver);
39.
} else {
40.
//A life has been lost
41.
//Handle this elsewhere
42.
SendMessage("OnLifeLost",
43.
lives, //Remaining lives
44.
SendMessageOptions.DontRequireReceiver);
45.
}
46.
}
47.
48.}
Listing 77: A script to control the number of lives for the player. This script must be attached to a permanent game object
in the scene
Search WWH ::




Custom Search