Skip to Content
Professional Windows® Phone 7 Game Development: Creating Games using XNA Game Studio 4
book

Professional Windows® Phone 7 Game Development: Creating Games using XNA Game Studio 4

by Chris G. Williams, George W. Clingerman
February 2011
Beginner to intermediate content levelBeginner to intermediate
552 pages
12h 40m
English
Wrox
Content preview from Professional Windows® Phone 7 Game Development: Creating Games using XNA Game Studio 4

Chapter 6. The State of Things

WHAT'S IN THIS CHAPTER?

  • Managing and tracking the state of your game

  • Handling transitions between game states

  • Detecting and handling phone hardware events

  • Understanding what happens when your game is interrupted by a call

  • Saving and restoring game state with local storage

A key part of game development is state management. This is how you handle the differences between the title screen and the middle of the game, as well as starting and ending your game, or even what goes on in the background while your game is paused.

When you receive an incoming phone call during your game, you don't just need to suspend game play and give control to the phone. You also must restore everything to the previous state when your player returns.

This chapter teaches you how to manage the state of your game and how to handle transitions between game states. You will also learn about detecting hardware events for the phone and how to use local storage to save and restore your game state.

GAME STATE

All video games go through various states as they run. Even the classic arcade machines used several states, such as running a demo in "attract" mode, the start screen displayed after you dropped in a quarter, an instructions screen, the actual game screen, and, of course, the high-score screen.

When designing a game, you must consider the various states and screens of your game before writing a single line of code. You need to know things like the following:

  • What screens are displayed, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

XNA Game Studio 4.0 Programming: Developing for Windows® Phone 7 and Xbox 360®

XNA Game Studio 4.0 Programming: Developing for Windows® Phone 7 and Xbox 360®

Tom Miller, Dean Johnson

Publisher Resources

ISBN: 9780470922446Purchase book