X hits on this document

240 views

0 shares

0 downloads

0 comments

89 / 102

}

...

186.

Override the LoadContent method in the CatapultGame class, in order to load the game’s sounds:

C#

protected override void LoadContent()

{

   AudioManager.LoadSounds();

   base.LoadContent();

}

187.

Compile the project and deploy it. The game should now be completely playable should include sound and animation.

Congratulations! The game is now fully operational.

Exercise 3: Adding Tombstoning

In the previous exercises we have implemented a fully operational “game” which contains game state management capabilities, several basic game screens and even sounds and animations. In this exercise, we will utilize additional Windows Phone capabilities, which will enrich the game with the new features. The most prominent of those capabilities, at least by its name, is the Tombstoning.

The complete list of the capabilities that we will use in this exercise is the following:

Tombstoning, which allows the game remember its state when player launches another application and then comes back to the game.

Isolated storage, which allows persist the game state and restore it on the next execution of this game.

Choosers and Launchers, which allows launch another application from the running game.

Those capabilities are redundant when we are writing Windows PC application, but they are critical when we are writing Windows Phone applications. The reasons for this are the following:

Due to the performance and the battery saving considerations, Windows Phone allows only one application to run at a time. This is why we need a special means, the Tombstoning, to come back to our game.

For the same reason we need Choosers and Launchers, to launch another applications from our running application. Note that our application will not run when another application should start. Moreover, the phone should know that we did not exit our application but just switched to another one and still may come back. The Choosers and Launchers address all those problems.

Page | 89

Document info
Document views240
Page views240
Page last viewedMon Dec 05 16:44:10 UTC 2016
Pages102
Paragraphs3115
Words17333

Comments