Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-20-2011, 01:45 PM   #1 (permalink)
Registered Member
 
Join Date: Feb 2011
Posts: 8
rew0 is on a distinguished road
Default 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.
rew0 is offline   Reply With Quote
Old 02-20-2011, 05:42 PM   #2 (permalink)
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

Quote:
Originally Posted by rew0 View Post
a) Should I have separate view controllers for Main Menu, Levels Menu and Game screens?
Yes; I'm sure they have separate nibs, outlets, and actions.
Quote:
c) Main Menu could call Levels Menu modally - is there any point? I've run into view animation limitations doing it this way.
No, I wouldn't load it modally.

Quote:
d) Should I be using a master view controller to manage the other three view controllers?
I'd look at Apple's "Utility" application and how it switches from front view to flipside view; then adapt that.
__________________

Free Games!
smasher is offline   Reply With Quote
Old 02-21-2011, 02:15 AM   #3 (permalink)
Registered Member
 
Join Date: Feb 2011
Posts: 8
rew0 is on a distinguished road
Default

Quote:
Originally Posted by smasher View Post
Yes; I'm sure they have separate nibs, outlets, and actions.

No, I wouldn't load it modally.



I'd look at Apple's "Utility" application and how it switches from front view to flipside view; then adapt that.
Thanks for the helpful advice - much appreciated. I'll proceed like you suggest as it makes sense for these screens to have separate nibs, outlets and actions.
It just felt wrong having the Levels Menu VC called modally, so nice to hear you confirm no need to do that.
I hadn't yet used the Utility App template so will take a look...

Last edited by rew0; 02-21-2011 at 02:27 AM.
rew0 is offline   Reply With Quote
Reply

Bookmarks

Tags
architecture, game levels, menu, view controller

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 425
8 members and 417 guests
chemistry, ChrisYates, hussain1982, Retouchable, skrew88, SLIC, walex, xzoonxoom
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,679
Threads: 94,128
Posts: 402,921
Top Poster: BrianSlick (7,990)
Welcome to our newest member, xzoonxoom
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:11 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0