X hits on this document

226 views

0 shares

0 downloads

0 comments

29 / 102

   graphics.IsFullScreen = true;

   //Add two new screens

   screenManager.AddScreen(new BackgroundScreen(), null);

   screenManager.AddScreen(new MainMenuScreen(), null);

   // AudioManager.Initialize(this);

}

Note that the constructor also contains a commented out initialization of an “AudioManager” class. We will deal with this class in the next exercise (and un-comment the relevant code to initialize it).

62.

Compile and deploy the project. You will see the game’s main menu and the exit entry will function as expected and cause the game to terminate:

Figure 24

The game’s main menu

Pressing the play menu item will reveal the instructions screen, which will not move on to the game until the next exercise.

63.

The final part of this task will be to add an additional screen, which will be of use later. Create a new class under the “Screens” folder and call it PauseScreen.

64.

Open the new class file and add the following using statements at the top of the file.

C#

using GameStateManagement;

using Microsoft.Xna.Framework;

Page | 29

Document info
Document views226
Page views226
Page last viewedSun Dec 04 08:49:11 UTC 2016
Pages102
Paragraphs3115
Words17333

Comments