Game Development Reference
In-Depth Information
Creating a high score menu
In this secion, we will create three menu pages.
First is the game over menu, which will contain the following:
F The final score of the player
F The text field for the player to enter his/her name
F The SUBMIT buton to save the player's score
F The LOCAL HI-SCORE buton to see the scores from the player's local machine
F The SERVER HI-SCORE buton to see the scores from the database server
F The RESTART buton to replay the game
Second is the local high score table menu, which will contain the high score data in the
scrolled area that loads the local high score data from the player machine when the player
clicks on the LOCAL HI-SCORE buton on the irst page.
Also, the server high score table page will be similar to the local high score page except
that the score data in this table will load from the database on the server, which allows the
duplicate names.
Prepare for Lift Off
Double-click the HiScore script to open MonoDevelop and start adaping in HiScore
script. Now we are ready to roll.
Engage Thrusters
We will start creaing the GAMEOVER menu by using the OnGUI() funcion, similar to what
we did in Project 2 , Creaing a Menu in an RPG :
1. At the beginning of this script, type the highlighted code in the HiScore.js ater
the line public var customSkin : GUISkin; , as shown next:
public var customSkin : GUISkin;
//Setting the default string on the submit text field
public static var userName : String = "Player 1";
//Setting the maximum number of users displayed on the scoreboard
public var maxUsers : int = 10;
 
Search WWH ::




Custom Search