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

Implementing the Quit Screen

You've already designed two user interface screens in earlier chapters, so this part will be a cakewalk to you, but you must implement this last screen. While the game is being played, you want the user to be asked whether she is sure that she wants to quit if she presses the Escape key. If the user accidentally presses the key, you won't lose all the hard work on the level. Go back to your UiScreen.cs code file and add the class in Listing 9.9.

Listing 9.9. The Quit User Screen
 public class QuitScreen : UiScreen, IDisposable { private Texture buttonTextures = null; private Texture messageTexture = null; private UiButton yesButton = null; private UiButton noButton = null; // Events public event EventHandler QuitGame; ...

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