While this game will be composed of a single game screen, other games might be composed of several screens, each for a different level, or from a combination of both. Different levels often reuse game screens while slightly altering the game logic. It is possible to logically relate to each screen or level as a whole game.
A game (whether actual or logical) usually have three states:
Loading – In this state, the system loads resources, initializes game-related variables, and performs any other tasks that have to be performed before the game actually begins. This state occurs only once in the game’s life cycle.
Update – In this state, the system needs to update the game-world state. Usually this means calculating new positions of the acting entities, updating health, ammo, and other statuses, recalculating the score, and performing other game logic according to the game. This state occurs throughout the time that the game engine is active.
In the XNA Framework, the Update and Draw stages can occur up to 60 times per second on a PC or Xbox 360™ and up to 30 times per second on a Zune™, Zune HD™ or Windows Phone 7™ device.
"Catapult Wars" game uses the game screen management architecture from the Game State Management sample (originally found at ), which provides some of the assets for this lab. The game includes the following modes:
Main menu (MainMenuScreen class)
Instructions screen (InstructionScreen class)
Playing the game (GameplayScreen class)
Paused (PauseScreen class)
The Game performs game-specific content loading during the GameplayScreen class’s initialization.
When launched, the game’s first action is to load and display the background screen and then the main menu screen. Once the main menu screen is loaded, the menus animate onto the screen and the user can then access the game itself.
We will talk more about the GameplayScreen class in the next exercise, where it will be implemented.
Page | 5