Game Development Reference
In-Depth Information
Chapter 10. Putting It All Together
In this chapter, based on what you learned in the previous chapters, we will create a
small game. We won't be using everything, but will use most of what you learned. This
chapter will be a great exercise to help you learn how everything we created works.
In this chapter, you will learn how to:
• Create a main menu
• Create a few playable levels
• Implement character interactions
• Use sound effects and music
• Use the save and load features you created
• Implement enemy AI
Creating levels
In the game, there will be three playable levels and a main menu. The main menu will
have three buttons on it: one to play the game, one for options, and a final one to exit
the game.
The main menu
Create a new scene and name it Main Menu . Next, drag the Audio_Config ,
Video_Config , and Config_GUI scripts to the main camera. These will be used
for our Options menu. Next, create a new C# script, name it MainMenu , and add this
code to it:
void OnGUI()
{
if(GetComponent<Config_GUI>().optionsGUI ==
false)
{
if(GUI.Button(new Rect(700, 400, 150, 50),
"Play Game"))
Application.LoadLevel("Chapter 10_a");
Search WWH ::




Custom Search