Game Development Reference
In-Depth Information
Chapter 9
Drone Grid Case Study: The User
Interface
This chapter will cover the user interface for our Drone Grid case study game. The Main Menu System
is covered first, which allows the player to choose between a new game, continuing an old game, or
viewing the high score table. Next, the creation of the high score table is covered, including the class
that is used to implement it. The high score entry menu is then discussed with the class that is used to
implement that menu system. Finally, a hands-on example is given to demonstrate these user interfaces.
Creating the Main Menu System
The menu system for our game will consist of a main menu represented by a MainMenu class.
Each item in the main menu is represented by a MenuItem class.
The MenuItem Class
The MenuItem class holds an item for a menu that also contains the actual 3D graphic.
The MenuItem class is derived from the BillBoard class.
public class MenuItem extends BillBoard
The MenuItem constructor calls the constructor for its parent BillBoard class. (See Listing 9-1.)
Listing 9-1. The MenuItem Constructor
MenuItem(Context iContext, Mesh iMesh, MeshEx iMeshEx, Texture[] iTextures, Material iMaterial,
Shader iShader)
{
super(iContext, iMesh, iMeshEx, iTextures, iMaterial, iShader);
}
321
 
Search WWH ::




Custom Search