Is it best to program a game for the iPhone in Objective C or in C++.
What language would a game like Flight Control be written in?
What format should graphics be in to show properly and load quickly on the iPhone?
views:
236answers:
6You will need to make your top level views and operating system interface in either Objective C or Objective C++. There is no way of calling the top level Apple APIs without it.
Once you get to the game logic, you can do most of your work in C if you wish to use Core Graphics or OpenGL.
Games like Flight Control are usually written in Objective-C with some C calls to OpenGL and other C APIs. The graphics can be stored in PNG or JPEG. I would stay out of C++ unless I had to use some C++ code or had developers with good C++ knowledge. According to my experience the bottleneck is seldom in the language, so that you haven’t much to gain by switching to C++.
You can now speed your development by using a language that doesn't require you as a developer to manage your memory manually and worry about leaks, that language is namely C#. The advent of MonoTouch is the magic that makes this possible but even before MonoTouch I've heard the Unity framework was used for several iPhone games with success.
Ok, to be less of a "commercial" (tough crowd...)
Using C# will allow you to relatively easily port your game to other mobile platforms (like the Droid) without a rewrite of the code. Objective C is hardly a language accepted widely beyond the Apple community. The AppStore is still growing thanks to iPhone4 and the iPad but the Android is nothing to sneeze at and there are other mobile devices to consider beyond the big two...
See this related answer regarding support for the Android.
Bottom line is larger audience = more revenue for you when writing the same code. My apologies if you were looking for a selection of either Objective C or C++ without bringing another option to light...
I appreciate everybody's quick response and expertise.
I am in the process of learning either C++ or Objective C and it looks as though Objective C is more direct to the iPhone.
My background is "gasp" COBOL85 (among other arcane languages). I would rather have someone already fluent in iPhone apps code the game, but I would guess the development costs would make that a little prohibitive. I do have a request for bid prepared, with "pseudocode", if someone out there would like to see it and give a quote. Meanwhile, there doesn't seem to be an advantage to C++ Ken [email protected]
You may also look at chipmunk (C) or Box2D (C++):
Should I go chipmunk or Box2D?