Game Development Reference
In-Depth Information
GUI.Box (Rect (0,0,250,70), "Game Over");
if(GUI.Button (Rect (75,30,100,30), "Play Again"))
{
Application.LoadLevel("racing");
}
}
else
{
GUI.Box (Rect (0,0,250,70), "Duck Herding");
GUI.Label (Rect (10,10,250,70),"Score: " + duckCount +
" Time: " + Time.fixedTime, myStyle);
}
GUI.EndGroup ();
}
function OnTriggerEnter(collision: Collider)
{
if(collision.gameObject.tag == "duck")
{
duckCount++;
Destroy(collision.gameObject);
}
}
function Update ()
{
if(Time.timeSinceLevelLoad > levelLength)
{
gameOver = true;
}
}
Step 23. Play. Once the game reaches 2 minutes, the game over
screen will come up and you can choose to play again. Unlike the
previous workshop, where the position of the players was reset with
the play again button, this one reloads the entire level. This saves a lot
of work remembering the locations of players and ensuring that any
stray ducks are removed from the environment. A clean reload will put
the game back in its starting state.
4.4.5 Searching
Searching is common human activity. Whether it is for food (in combination
with collecting—hunting and gathering), car keys, or Russian Ultra-
nationalists in Tom Clancy's Ghost Recon , the human brain is attuned to
quickly examining environments and looking for icons and patterns. Naturally,
the searching mechanism goes hand in hand with matching.
Search Nedrilad ::




Custom Search