Game Development Reference
In-Depth Information
6. Each time update() is called, the Time script will set the text of the
GUIText component to be the string concatenation of Time and the elapsed
time left (cast as an integer). We cast it to an integer to remove the trailing
decimal points as shown in the following code:
this.gameObject.GetComponent<GUIText>().text
= "Time : "+((int)t).ToString ();
Congratulations! We now have a working game clock to add just enough game-play
pressure to the player in the level. Consider adjusting the amount of time you give to
the player based on a difficulty setting in your game, the age of the player, or perhaps
on how well the player is actually playing in the game. Remember, flow is achieved
not only when the task at hand is somewhat challenging, but also in a scenario of
moderate pressure.
Search WWH ::




Custom Search