iPhone game programming for noobs

Nibbie
Posts: 1
Joined: 2009.08
Post: #1
Hello, I want to start game programming for iPhone but I am stuck, I started by learning Objective C 2.0, followed by reading the book "Beginning iPhone 3 Development: Exploring the SDK", following the examples in each chapter, then I watched online tutorial regarding to Core Animation/CALayers, then read source code of 2D games/programs, but now I am stuck, can anyone point me to the correct direction so that I can have a feel of the basic template/skeleton of a 2D game?

My questions are:

1 for a game with several "views", for example, a title screen with "start/load/about/exit" menu, and a game play screen when user clicks "start" in the previous menu, do I use multi views or multi CALayers(each layer represents a particular screen, with several sublayers for componenets in that screen)?

2 what the main loop looks like and where should I put it?

3 where do I put the initialization code? Some of the tutorials I read has put them to "applicationDidFinishLaunching", but others have either dedicated "init" method or put them to a method called "loadFromNib"(can't remember)

Thanks a lot!
Quote this message in a reply
Moderator
Posts: 3,572
Joined: 2003.06
Post: #2
First thing I'd do is ditch the CoreAnimation route and go with OpenGL. I tried CoreAnimation on iPhone last year when it was first opened up. It works great at first, but you'll find performance limitations sooner or later. Better to invest your effort in learning OpenGL instead, IMHO. It's great that you've already learned some Objective-C though, since that'll definitely help.
Quote this message in a reply
Moderator
Posts: 133
Joined: 2008.05
Post: #3
It depends entirely what you are doing. Core Animation is perfectly suitable for some types of games.

Typically, you want to think about the number of on screen objects. If you have a lot of on screen objects, you'll want to use OpenGL. If your game only consists of a few images being moved around the screen (like a chess game), Core Animation is going to be the better choice.
Quote this message in a reply
Apprentice
Posts: 10
Joined: 2009.08
Post: #4
Quote:Typically, you want to think about the number of on screen objects. If you have a lot of on screen objects, you'll want to use OpenGL.

What would you define as "a lot" and are there ways to improve speed without reverting to OpenGL? I think I have about 15 screen objects and it was running a little slow. I freed up quite a bit data and other views I was not using during game play and have yet to tested how much speed I have gained from it.

I am also using timers and layer animations consistently throughout game play. Not sure if those can be re-factored.

The game I am making it simple and almost complete. I am going to learn OpenGL for my next game but would like to put it off until then.

Any suggestions would be greatly appreciated. Let me know if you need anymore information.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  New iphone game programming tutorials for newbies Eskema 2 3,176 Mar 1, 2010 01:07 PM
Last Post: Eskema
  Game Programming Questions miigman 11 6,729 May 21, 2009 11:24 AM
Last Post: MikeD
  iPhone 2D game programming WarPug 2 3,255 May 11, 2009 09:50 PM
Last Post: Avenger2008
  Eager to learn game programming.. dont know where to start.. gizmo99 0 1,969 Dec 4, 2008 07:12 PM
Last Post: gizmo99
  Welcome to our iPhone and iPod Game Programming Message Board Carlos Camacho 0 9,299 Jun 10, 2008 05:21 PM
Last Post: Carlos Camacho