Iphone game dev, c++ / mac comparison - iphone

Hey guys, I've done some research but still unsure.
To get into IPhone Game Dev properly do I need to use Objective C rather than C++ ? I'm happy to invest in a mac mini and want to make sure I'm using the same systems/platforms professional Iphone Dev's use. Are most of the tutorials out there in Objective C E.T.C?
Cheers!

it's totally up to you. If you decide to write your own game engine you can do it in Objective-C or C++. IMHO there is no single proper way to do game dev. I use mac mini and do parts of my coding in c++ if I find that easier than coding in Objective-C. After all you don't want to mix engine stuff (probably using opengl) with ui stuff so your code gets separated anyway. It honestly doesn't matter what is the language of your game engine as long as you can use it on idevice and are comfortable writing in.
So to sum up, you don't have to cling to one language. Write your UI in objective-c and prepare the environment to use opengl and then write your engine in c++ if that suits you.

The fact that OpenGL ES is written in C means you can use C, C++, Objective-C or Objective-C++ to write your game engine. So use what you're comfortable with.
Many of the books that I've seen out there assume C++, but as I say, you can do your engine in anything of the above.

Related

iPhone to Flash porting

I need to port an existing game written for the iPhone to Flash. The iPhone game is mainly written in pure C rather than Objective C.
I'm wondering if there are any good tools for converting the C code to Actionscript directly, or in general if anyone has some advice on how to do this porting in an efficient way given its C based source code?
Since the game will keep getting updated with bugfixes etc, a method allowing rapid conversion of the updated game code to Flash so that only one code base would need to be maintained would be optimal.
Take a look at Alchemy. This might be what you want, but I suspect you will have issues simply compiling on different compilers since the user-input differs immensely between a flash game and an iphone game.

Engine for use with PC and Iphone?

Are there any engines that allow me to develop for pc and iphone at the same time? My preferred language would be c#, but that probably won't happen, so I probably will learn c++ or java.
I want a 2d engine, by the way.
No experience with it but...
http://www.torquepowered.com/products/torque-2D/
C# and Java aren't allowed on the iPhone, so a C or C++ engine would be your best bet. I'm guessing you're doing a game--if so, you'll probably want to use OpenGL. I don't know any specifically, but here's a full list.
Working with pure Core Animation layers can yield cross-platform 2-D drawing and animation between iPhone, iPad, and Mac. As an example of this, the Core Plot framework runs on Mac and iPhone from the same codebase. Core Animation lets you do some pretty complex animations and layout in 2-D.
It is against the rules in OS 4 to write an iPhone app in something other than Apple's dev tools. However, IANAL but I'd expect that it is in theory ok to take the app you made there and then try to run it on an emulation layer etc.. on the /other/ platform(s). Not sure about direct solutions, but check out the GNU Objective-C runtime / GNUStep, they might be a helpful starting point.

Port Flash to iPhone

How hard would it be to port a flash game to the iPhone. Obviously Flash CS5 is no longer an options, I still would like to know if there's anything that can be reused? or do I have to write everything from scratch (Is Obj-C that different than ActionScript?) Is there any other shortcuts?
Also, if anyone has done this before please share your experience.
Flash is a very different platform, not only is the language change going to be an issue you're going to be going from Flash's renderer to presumably your own using OpenGL:ES.
Although another method may be to port your app to JavaScript. Both ActionScript and JavaScript are EMCAScript dialects, so very similar in that area, the APIs will be completely different though.
http://paulirish.com/work/gordon/demos/ interesting and slightly related, this is a implementation of Flash in JavaScript.
Note the new Apple T.O.S may affect you, but as far as I'm aware it's still a beta and I'm not Apple or a lawyer so I won't try and decipher it for you.
I am doing the same thing. I am using Cocos2d for iPhone. This is a pretty good 2d game engine. Actually, two apps created with it are in the current top 25. You are going to have to get down and dirty in Objective-C though. Objective-C is different from ActionScript but if you are use to object oriented programming you should be able to make the switch. Programming a Flash game is different than typical game programming done in Objective-C/C/C++. So, if you are familiar with how to do things in the Objective-C/C/C++ game programming world (render loop, capturing inputs, etc), you'll really be ok. If not, you'll have to get use to not having the Flash timeline, dealing with frames, etc. Good luck! You can do it!
read the statements from apple, no its not possible.
For my game Hudriks I used flash to build levels and some animations. For this an animation engine has been developed that supports motion tween, and then wrote JSFL scripts that goes through Flash objects and export to a format that can be parsed in my game.
For writing the JSFL - look for document called Extending Flash.
The rest was developed from scratch using Objective C with OpenGL. Do not see option of 'one-click' compilation or converting from Flash to iPhone (not considering CS5), but with developing extensions for Flash you could reuse some work.
It is hard, but it is possible. I am working on a automatic code converter now.

iPhone:Learning Cocos2D project

I want to develop a game in a month by using the Cocos2D Open Source game engine. Learning Cocos2D is a bit hard and I don't know how to create my initial project by using the files provided by Cocos2D base project. I doubt whether it is possible?
Can I learn by using Cocos2D base project directly and modify it for my game application? Does the license allow me to use like that? ( Because I can't learn all OpenGL programming concepts and develop an application in a month, which is very hard. )
Appreciate your thoughts and advice.
Thank you.
, I have been programming games for iPhone for more than a year now! I started doing most of the things in Objective-C but then I learned that for most graphically ( or computation ) intensive games, Objective-C is not really the best option. There are a lot of paths like Pure Objective-C for logic, and inline C functions for the more "intensive" parts of your game, Obj-C does also let you use C++ files ( for the model classes for example ) with Obj-C++ (which is basically a .m Obj-c source code file but renamed to .mm for Obj-c++ ).
Having said that, Cocos-2D is in my opinion a wonderful library, it's mostly written in Obj-C but has pure C parts for the most CPU intensive stuff (physics it's chipmunk physics and Box2D, they also have a hash table library written in pure C to avoid calling NSDictionary a lot). Cocos2D is not hard to use, and you can get a nice game working quite fast!
You can embed the whole Cocos-2D to a project of yours, or just embed some useful parts of it (like Cocos-Live for On-Line scores, the Texture loaders, etc). You could also start working directly from the Cocos-2D Xcode project and remove what you don't need (like examples etc).
For a simple explanation of the Cocos-2D license , read Here !
About OpenGL, with Cocos you won't need to learn it deeply, unless you start getting into very custom stuff.
Having said all that, here are my recommendations :
1) GUI takes time, GUI can take a lot (even more than 50%) of your source code actually... so take that into consideration if you are going to have game menus, etc.. and adjust your time schedules to make the GUI coding fit!
2) When you have learned Cocos a bit, start playing with OpenGL, it's a wonderful ride, and it's really great to know a bit about the "Engine" of your "Car" so if your "Car" (Cocos2D) break's or doesn't do exactly what you want, you can always tweak here and there to make it work.
For what it's worth, I tried to pick up Objective C a few times over the last year but gave up pretty quickly each time (though I used to do C a lot in the early 90s). Just over a week ago, though, I watched some screencasts and eventually decided to start making my own game. I then discovered and gravitated toward using Cocos2D.
Now, 9 days later, I have a prototype of a game done (it's a kinda clone of Robotron 2084). It's been great fun doing it so far and while this is not the most up to date version (this was at the 1 week mark), this video will give you an idea of what I've achieved: http://www.youtube.com/watch?v=lzD6va1GiTI
I started by using the default Cocos2D project and just figuring it out and adding stuff as I went. I did a TON of Googling and often ended up here on Stack Overflow and on the Cocos2D iPhone forums (which are VERY useful). I've scratched my head a lot but it's been a fun experience (except for tracking down memory leaks ;-)).
Cocos2D is, I believe, LGPL licensed but has some extra clauses tagged on to make it even more free so you can use it in your iPhone game projects commercially or not without any problems.
I've found you don't need to learn much about OpenGL. I've copied and pasted some free snippets from here and there but they've been simple to figure out. Things like drawing lines and boxes, etc. I haven't learnt any "hard" OpenGL stuff. I've just stumbled and got a pretty long way, IMHO. I now feel pretty confident and am still finishing off this game to get it on the App Store and want to develop more!
Make sure to start with the latest Cocos2D 0.99-rc because they changed a lot of names and it'll annoy you if you have to upgrade in future. It's very stable and works fine. Go to http://www.cocos2d-iphone.org/download and download it, unpack, then run the template installer. Then create a project using the Cocos2D template in XCode and Build & Run it on the iPhone Simulator. You'll get a basic example that you can then dig around in. Read the Cocos2D iPhone "Programming Guide" on their site too and gradually figure out how to change the scene to do something you want it to do. Small steps, etc :-)
If you have programmed games before AND you have some experience with Objective-C THEN you could develop a game in a month. The complexity of the game is a big factor.
I think Cocos2d is a very good framework to help you get started in 2D game programming for the iPhone.
Here is a very nice tutorial that will get you started: link text

Iphone Game Development

What are people using mostly to build iPhone games with? I'm learning iPhone programming. Currently I'm watching all the stanford vidcast, doing the assigments and going through the beginning iphone development apress book. I want to get into building games and want to know if developers are buidling everything with opengl es or are they using pre-existing game engines?
Depends how graphic-intensive the app is.
If it needs a lot of graphics, go with a pre-existing engine.
If not, many use OpenGL ES
I believe most people are simply using Apple's APIs. Other than that, I think cocos2d is pretty popular.
You can find a bunch of suggestions here:
learning iphone game development
Which technologies/concepts do you suggest I learn before creating an iPhone game?
I used Unity. There's been a lot of great games (even in the top 10) that used it. You don't even need to know objective-C. The code is written in scripting languages using C#, Javascript or boo and then compiled. It is expensive. It will cost you a minimum $600 for an indie license to do iPhone apps. unity3d.com
It's tough to get up to speed writing a game with all the APIs to learn and few good game examples (especially if you are new to Objective-C). I ended up tracking down the old crashlander source, which is notoriously hard to find since Apple pulled it.
There are probably half a dozen iPhone game programming books in the pipeline. Until then, the learning curve is pretty steep.
I'd suggest starting with an OpenGL 2D sprite-based game. Start by learning OpenGL ES, the touch system, then the audio system.