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 ...

Get Beginning 3D Game Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.