Cocos2D – Enabling iPhone Game Development in Hours

About a month ago I purchased an iPod Touch and began experimenting with iPhone SDK and exploring various user interfaces and applications released in the App Store.  I haven’t really spent all that much time in the last month experimenting as my day job has been keeping me quite busy, as well as a few other ventures I’m working on in the evenings.  With that said, I read one or two ‘intro to objective-c’ articles which were fairly basic and assumed prior programming knowledge.  Getting a general grasp of Objective-C in a few hours, I followed a couple of ‘Hello World’ style tutorials for building ‘your first iphone app’.

All of these left me puzzled and quizzical in the end, wondering … how I did it.  I know ‘how’ I did it, but I didn’t understand ‘how I did it’, if that makes any sense at all.  Objective-C is quite an odd language, for a person with my background at least … C, C++, Python, Perl, Basic, Visual Basic, C#, JavaScript, ActionScript, etc, etc… to name a few.  Objective-C is very similiar to all of these, however, it’s use of brackets just confuses me and makes my eyes roll into the back of my head.

I researched a little, and found a handful of Game Engines that support the iPhone Platform, such as Unity 3D, Torque Game Engine, Torque Game Builder, Shiva and Oolong.  I own a Torque Game Engine license, as well as a Torque Game Builder and Unity license as well.  I have experience with these engines, and thought they would be the best way to get started with iPhone Game Development.  Sadly, the cost of the licenses for iPhone support are quite high.  Well beyond the reach of a simple indie game developer who has yet to make a penny out of his hobby.

I ran into the Cocos2D library, and found that it also has support for the iPhone Platform.  A ported version of the Cocos2D project to Objective-C, named Cocos2D-iphone seemed a likely choice for a quick start.  I did a little digging around, read some documentation (what little there was), reviewed some samples and watched a couple of Videos from the Cocos2D project to get a general grasp of how the library works.

This morning, I started around 10am and by 5pm had an almost feature complete ‘working model’ of a Space Invaders clone.  Written entirely in Objective-C, using Cocos2D-iphone.

Now, I must say … it took quite a bit of digging to find the things I needed, and most of the information I needed to know … was retrieved from undocumented sample code.  Good thing I can read code, eh?

I am hoping to finish up my Space Invaders clone, and release it to the App Store in the near future.  I only had the day to work on the project, and was quite impressed with how much I achieved in such little time.  Cocos2D-iphone definitely gets two thumbs up from me.  It’s the perfect library for my next project as well (the space invaders clone is not an official project, it was just a quick way to learn Cocos2D-iphone and Objective-C).

2 comments for “Cocos2D – Enabling iPhone Game Development in Hours

  1. February 25, 2010 at 8:43 pm

    I developed my game from scratch in Objective C, it was very frustrated. I am at a point where I have the game engine working but it looks like crap and runs kind of slow (I am using Quartz). At this point, would it be worth it to switch to Cocos2D?

  2. February 25, 2010 at 10:28 pm

    I am not familiar with Quartz development and couldn’t tell you if the time to convert to Cocos2D would be ‘worth it’ in the long run. I would however suggest giving Cocos2D a good thorough test run as I believe it’s a solid graphics engine and has everything you need to develop a solid game.

Leave a Reply