Game Development Reference
In-Depth Information
Adding a little flair
In an ode to the fantastic game Star Command ( http://www.starcommandgame.com/ ) ,
where when a battle starts there is a little introductory animation that introduces the two
parties in battle, I added the Intro state sequence, which currently just displays a mes-
sage about the battle.
Tip
I was going to add a full animation to zoom and highlight the player and the goblins and
then show the vs message, but I'll leave that up to you to play with. Can't have all the fun
now, can I?
Currently, the state machine pauses at the Intro state for a few seconds, so while it's
paused, let's add a simple GUI dialog to tell the player about the impending battle. Simply
add the following to the case line of the Intro state in the OnGUI function:
case BattleState.Intro
GUI.Box(new Rect((Screen.width / 2) - 150 , 50, 300, 50),
"Battle between Player and Goblins");
break;
Now the player is informed that a battle is about to happen whether they like it or not (and
now he cannot run away again, yet!).
Search WWH ::




Custom Search