Hi,
I want to make a 2d mario like game for the iphone. I read a few months back that apple allows c++ games in. I know c and c++ What is my best course of action to making iphone games??
Do I have to learn Obj C?
Yes, C++ can be done, but there's a lot of tweaks you have to do to the compiler and reading of the frameworks...since they are all set for Objective-C.
If you already know C and C++, then it's not going to be much of a leap at all to add Objective-C to the belt.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
I made a game in using SDL/OpenGL and then ported it to iPhone. The main thing I had to do is wrap the entire game into a game class so it was like
game->step();
then in the drawing section
game->render()
and do something about event handling. I had my own joystick class so luckily I just had to add code the iPhone event style to invoke the joystick object as changes occur. eg in accelerometer event I would do joy->axis[0] = some number based on the acceleration.
but using c++ I didin't have to tweak the compiler, just remane all the files to ".mm" which is the file extension for objective-c++.
If you find a way to keep the original extension of .cpp and have xcode treat it as obj-c++ please do share.
Bookmarks