First iPhone/iPod Game

by edo on February 14, 2010

This post is really more about giving props to Ray Wenderlich and his recent tutorial "How To Make A Simple iPhone Game with Cocos2D".  I just finished following this tutorial and I have to say it worked perfectly.  I literally had a simple game up and running on my iPod Touch in about 20 minutes.

With regards to iPhone ownership and development, I'm a bit behind the curve.  I only just recently (last week) got an iPod Touch.  Regardless, as soon as I received this shiny new device of wondrous possibilities, I wanted to do was wade in and start making games.  However, before I could  start, I had to resolve some issues and answer some questions:

  • Question #1: Use TGB + iTGB or start at a lower level? - I struggled for about a week trying to decide whether to try making my first game using TGB + iTGB, or to write my app on the bare metal starting from an OpenGL ES framework, or to instead use some free SDK/Framework. Typically, I would have chosen the TGB+iTGB route, but I was faced with an underlying issue (#4 below).  I don't know Objective-C and it seemed wise that I invest some time learning it.  That said, I figured starting closer to the metal would be best.  So, the question remained, "how close to the metal should I get?"  After some deliberation I decided that I would not start at the lowest level (OpenGL ES framework in Xcode), but rather a little higher.  I chose instead to start by using the Cocos2D iPhone framework.
  • Issue #1:  Register as an app developer - This is hardly and issue today.  Simply go to the iPhone Dev Center, create an account, and follow the steps to register for as an iPhone Developer.
  • Issue #2: Installing SDK - Yet another minor issue (more of a step).  Once you're registered, go download either the 3.1.3 SDK or the 3.2 SDK (for iPhone and iPad devlopers; This requires Snow  Leopard to install.)
  • Issue #3:  Provisioning your iPhone/iPod - This is the first real issue I ran into.  Call me stupid, but I had some trouble figuring out the right steps to provision my iPod so that I could run test apps directly on it from Xcode.  (Yes, there is a simulator, but nothing compares to testing the app in your hand on a real device.)  Fortunately for me (and for you if $5 is not a barrier), the folks over at Mobile Orchard have a screencast one can buy for $5 which shows the steps for provisioning a device (and iPod in my case).  I bought this, followed the steps, viola ready to go!  (On another note, these guys have some podcasts worth listening to also.)
  • Issue #4: I don't know Objective-C - This is another true issue for me.  I'm a C/C++ programmer of many years (> 20) experience with tertiary experience in a variety of other languages (COBOL, Fortran, LISP, BASIC, Pascal, Ada, ...), but I have never programmed in Objective-C.  This is clearly an impediment and a requirement for any serious OS X and/or iPhone coding.   Fortunately, Apple provides a wonderful online library.  Additionally, I tracked down a very useful document for C++ programmers like myself: From C++ to Objective-C.
  • Issue #5: iPhone SDK has a lot of features! - This is actually a great "issue" to have.  Yes, it means I have a lot to learn, but that's awesome because when I do learn it, I'll have lots of ready-made and otherwise useful content available to me.

...

I could probably go on, but I've been typing for a bit now and I want to get back into coding.  So, wish me luck.  I'll be back later with more details and maybe a few screenshots of my first "on my own" iPhone development excursions.

-edo out

{ 1 comment… read it below or add one }

GeorgeSealy February 15, 2010 at 9:24 pm

Welcome to the world of iPhone development! It’s a great little platform to develop for. Don’t worry too much about Objective-C. The nice thing is that it’s possible to use it as much or as little as you like, even combined with C++ in the same file (although I try to keep the two separate).

Leave a Comment

Previous post:

Next post: