Using while loops for each section of game?

Discussion in 'iOS Programming' started by mymac1, May 30, 2010.

  1. mymac1 macrumors newbie

    Jul 28, 2009
    I have a question with regards to using while loops within a game program.

    For example my program would be split into many sections and may look like the following:

    main menu and start prompt
    load pre-saved game option
    main game level 1 play
    gameover screen,etc..

    The main menu with start prompt would draw the screen with button, and would continuously loop until an option (in this case start) was selected, at which point would proceed to the next stage which would be the load pre-saved game.

    My query is regarding a separate 'redraw screen' method, can I have the system call this automatically, even though it is not included in the while loop, or do I have to include refreshview in every while loop/segment?
    Also would using the while loop disrupt any other iphone routines?

    Thanks in advance
  2. PatrickCocoa macrumors 6502a

    Dec 2, 2008
    Good luck

    Have you done any game programing on other platforms? It seems that you have from your question - you're trying to port some other game to the iPhone.

    Have you done any programing for the iPhone (game or not)?

    Your best bet may be to buy an iPhone game programing book and work through it. Then you can take what you've learned specific to the iPhone and apply it to your game.

    Good luck, let us know how it turns out.

    (You're in the wrong forum, try iPhone programming).
  3. mymac1 thread starter macrumors newbie

    Jul 28, 2009
    Yep a book would be ideal, however there are so many and only very few would apply to my needs, any suggestions to what book would be ideal?

    I basically have my own learning plan, researching and determining what specifics I need for now and expanding that to cover range of related subjects (nothing worse than sitting for weeks on end mulling through a lot of technical publications, to then realise it is completely irrelevant at that stage in learning).

    Thanks for the pointer though, let me know the book to go for and I will certainly consider.


Share This Page