Game Development Reference
In-Depth Information
Most games comprise several views—not just the view where the main action of the game takes
place. These views often include a Welcome view, a High Score view, and maybe a few others. The
sample code that accompanies this chapter is designed to outline how these supporting views are
managed. Figure 3-1 is a flowchart of the views used in this game.
New/Continue
Launch
Image
Auto
Loading
Auto
Welcome
Play
End Game
Done
Done
View
View
High
Scores
About
CoinSorter application flow
3-1 , each rectangle is a view in the game. The arrows indicate the transitions between
app delegate. See Appendix A for the details of configuring this image. When the application has
fully loaded, we display the Loading view. This view stays on the screen for a few seconds while
the application pre-loads some images. Once the images are loaded, we show the user the
Welcome view.
The Welcome view in Figure 3-1 offers the player a number of options. They can continue an old
game, start a new game, view the high scores, or view information about the game. If the user plays
the game, they are directed to the Play view, where the main action of this application takes place.
When they are done with a game, the user is shown the High Scores view. When they are done
reviewing the high scores, they are sent back to the Welcome view, enabling them to again select
from the available options.
The application flow presented in Figure 3-1 is by no means the only option, but it presents a
common pattern. Extending or modifying this example should be simple once you understand what
each view does and how the state of the application is managed.
Note Although laying out this type of workflow with the Storyboard feature of Xcode might be
appealing, supporting multiple orientations and multiple devices makes using Storyboard impractical.
Ideally, Storyboard will improve in future versions of Xcode and become the only tool used to manage
application life cycles.
 
Search WWH ::




Custom Search