Best practice multi-level game view controller architecture
Hi,
Newbie here. I've been searching around for some best practice advice about multi-level game architectures - particularly use of view controllers. I have read through the (relevant parts of the) Apple docs as well as the excellent Beginning iPhone 3 Development book.
The architecture I have in mind is quite often used by games in the App Store, but it seems quite difficult to find an explanation of associated view controller structure (or I'm being blind...).
So here goes:
1) Splash screen - no probs, use default.png
2) Main Menu screen with Play button & sound on/off. Play button leads to:
3) Levels Menu screen - multi-page horizontal scrolling with level number buttons (greyed out if not completed). Also contains the same sound on/off button plus a "back to menu" button. Clicking a level button takes you to:
4) A pre-level view animation leading to the relevant game level. Each game level also includes the same sound on/off button, a Levels button to return to the levels menu screen, and finally a button to pop-up some info during game play (that'll be done modally). Then a post-level view animation leading to the next level.
Yes this is rather similar to Angry Birds, I know...;o)
Although the game levels (eventually 100...) will all have slightly different layout and logic, I am trying to re-use as much as possible.
Questions:
a) Should I have separate view controllers for Main Menu, Levels Menu and Game screens?
b) Or should Levels Menu and Game screens be in one view controller?
c) Main Menu could call Levels Menu modally - is there any point? I've run into view animation limitations doing it this way.
d) Should I be using a master view controller to manage the other three view controllers? Problem here is that this is not a Tab Bar or Nav Bar application...but is there a way of still using a master container view controller?
Sorry for being such a dimwit, but I'd really like to understand best practice in this area before diving into the detail. Not expecting anyone to write any code for me (especially with the complexity outlined above...) but any pointers to good posts, tutorials or books would be much appreciated. Most of what I've seen deals with switching between two views only.
Thanks a lot,
Rich.
|