X hits on this document

214 views

0 shares

0 downloads

0 comments

91 / 102

Note the highlighted statements, which were added to use the using Tombstoning and Isolated storage capabilities.

190.

Locate the "Fields" region and add the following field:

C#

string fileName = "Catapult.dat";

This field stores the name of the game state file. Later, we will see how to create this file in the Isolated Storage.

191.

Replace the class constructor with the following code:

C#

public CatapultGame()

{

   graphics = new GraphicsDeviceManager(this);

   Content.RootDirectory = "Content";

   // Frame rate is 30 fps by default for Windows Phone.

   TargetElapsedTime = TimeSpan.FromTicks(333333);

   //Create a new instance of the Screen Manager

   screenManager = new ScreenManager(this);

   Components.Add(screenManager);

   //Switch to full screen for best game experience

   graphics.IsFullScreen = true;

   //Add two new screens

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

   mainMenuScreen = new MainMenuScreen();

   screenManager.AddScreen(mainMenuScreen, null);

   AudioManager.Initialize(this);

   InitializaPhoneServices();

}

192.

Locate the "Initialization Methods" region and add there the following code:

C#

private void InitializaPhoneServices()

{

Page | 91

Document info
Document views214
Page views214
Page last viewedSat Dec 03 03:02:26 UTC 2016
Pages102
Paragraphs3115
Words17333

Comments