Game Development Reference
In-Depth Information
We will start by creaing the high score menu for saving and loading the score from our local
machine by using the PlayerPrefs class in Unity, which allows us to save the parameters
locally to our machine (this is very similar to SharedObject in AcionScript 3.0).
Then, we will create the C# XMLParser script that will be used to get the XML value of the
return data from the provided database server. Next, we will create the Unity Javascript ,
which will handle the posing and loading of scores from the database server.
Finally, we need to encrypt our high score by using the MD5 encrypion class writen by
Mathew Wegner . For more details please refer to the following website:
http://www.unifycommunity.com/wiki/index.php?title=MD5 .
The MD5 encrypion script will allow us to encrypt the hash key, which will prevent
submission of fake high scores.
What Does It Do?
When we finish this chapter, we will have the GAME OVER menu, which has four butons to
allow the players to submit their score on their local machine and server database, to load
the high score data from the player's local machine, to load the high score from the server
database, and a RESTART buton to replay the game.
Why Is It Awesome?
What we will get from this chapter is the way to use PlayerPrefs to save high score. This
PlayerPrefs also allows us to save game data, such as the locaion of the player, current
stage, or current hit points. We will learn how to set up the basic database server by using
MySQL and PHP script to return the high score data in the XML format to the game. We will
also look at how to create the C# script to parse our XML data for using our high score table.
Lastly, we will get to know how to use MD5 script to encrypt the user data before sending to
the server database.
Your Hotshot Objectives
We will start by imporing the chapter8 package, which we will download in the next
secion, and then begin creaing the high score table with the following topics:
F Creaing a high score menu
F Saving and loading local high score
F Geing XML data from server
F Posing and loading high score to server
 
Search WWH ::




Custom Search