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

Updating the Game Engine with This New Screen

Now you're ready to update the main game engine to use this new screen. As before, you want a Boolean variable to determine whether this screen is being shown, as well as an instance of the screen declared with your game engine variables:

// The Selection screen for choosing loopy
private SelectLoopyScreen selectScreen = null;
// Is the selection screen currently being shown
private bool isSelectScreenShowing = false;
// Textures that will be shared throughout UI screens
private Texture buttonTexture = null;

Naturally, you need to create this object as well. Notice that you've also declared the texture that contains the shared texture for the buttons. Find the spot where you created the main screen ...

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