O'Reilly logo

Beginning 3D Game Programming by Tom Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Plugging into the Game Engine

That's all there is to the main menu screen for your new game. Now all you'll need to do is plug it in to your game engine, and you'll be well on your way to having a fully functional game. Go back to your game engine class, and add the following two variables to your class:

// Is the main menu currently being shown
private bool isMainMenuShowing = true;
// The main UI screen
private MainUiScreen mainScreen = null;

These control the main menu UI screen, as well as determine whether this screen is currently being shown. Because the first thing you see when you start the game is the main menu, obviously you want this Boolean variable to default to true, as it does here. Now you actually create an instance of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required