No pain, no game – making your first iPhone game

Update: Flap Flap is now available on the App Store!
Click here to view the iTunes web page!

This morning I got an e-mail from Apple saying that my upcoming game Flap Flap is in review. That means the game is either coming out in a few weeks (wheeee!) or that they will find errors and that it needs more work (booooh!). So instead of just sitting on my ass and twisting my thumbs, I thought I should write a short “making-of” blogpost. Making an iPhone game is really hard work and the process might be interesting for some of you to read about.

Loading screen from my game Flap Flap

I had been reading up on Objective-C and dabbling with the Xcode toolset, making very little progress and being overwhelmed by the complexity of memory management, C syntax and millions of header and implementation files. I work as a web developer in my day job, doing most of development on the Flash platform. Trying to learn Objective-C was overwhelming to say the least. I like visual programming and like to prototype rapidly and visually. In iOS everything was hard. Bloody hard. Object-oriented code was still quite new to me, and making even simple things seemed very complex.

Memory handling. It sucks.

At some point I found the Cocos2D framework for iPhone. It’s a 2D toolset that makes writing visual stuff much easier, as it has sprite classes, actions, timers, schedulers and a sound engine (and LOTS more stuff). Coming from Flash this was more familiar territory. I started looking at examples and trying to understand the code, and gradually I realized that Cocos2D would be my entry into iPhone programming.

GUI Sketches. Very polished stuff.

August 2010 I released my first iPhone app, the Mouth Harp. It took around two-three months of after-hour work, but I was happy with the app and it introduced me to a lot of concepts that I would later need to make a game. My goal was to sell 100 copies worldwide, but as of now I’m close to 300. For a limited-market app I’m quite pleased to see it selling one or two copies every day across the world. (On the other hand – I haven’t yet reached the payment threshold set by Apple, so no fancy dinners for me yet). Over Christmas I made the app free and got almost 12000 downloads in 5 days.

So, after The Mouth Harp was out I wanted to do a game for the iPhone. I have done game programming for years (like the adventure game Madhouse-indian spritit for the Amiga in 1995. Maybe I should make an iOS remake. Sadly all the graphic assets got lost.) and lots of small flash games for work.

An ugly, but functional, early prototype of Flap Flap

I had an idea for a flying bird game and knew from the start I wanted to make a game with very simple controls. You should be able to play it on the bus with one hand. Originally the idea was to control a large albatross trying to find thermal lift, making it an endless game but with a very slow, relaxing feeling. But as I started prototyping a test, I quickly realized a more arcady feeling was more apt. I introduced some enemies and some objects the player had to pick up to create some simple goals. It was pretty fun, but very simple. But then I got the idea of colour matching to unlock different flying modes. The game mechanics were set and so was my goal – keeping the game simple and fun while adding a little bit of extra challenge.

Early sketches looking for Flappie.

After the game engine prototype I realized I could probably make a playable game and started out doing some more visual programming. I wanted parallax scrolling and hand-painted backgrounds, so I had to come up with a game engine that both kept the bird flying and the world around it moving appropriately. I soon hit performance problems and spent a lot of time re-writing the engine so that it ran on the older iPhones. I ended up using sprite sheets – large graphics that hold all the smaller, individual graphical elements – and using code to animate and move them.

The main menu for Flap Flap

Over the next three months I spent almost every night working on my game. The fun parts of designing enemies, animating stuff and painting were soon taken over by coding challenges. I had to refactor a lot of code as I realized I wanted different levels or worlds (using friends as playtesters is a great way to get quick feedback!). The class list grew larger and at some points I felt I was going to lose track of my progress. In retrospect some sort of task-based management system might have been useful, but forcing me to keep my code as clean as I could manage saved my ass.

After refactoring almost every part of the game I went back and worked on the most boring parts. Making menus, handling game logic, adding a pause mode that worked with multitasking, making sure that sound was playing etc etc. I also realized that I really wanted to add Game Center achievements and leaderboards to the game. That would make the game more challenging for the player, and more rewarding as you spent more time with it.
Adding Game Center was a major hurdle. Implementing it into my Cocos2D game was hard, as was the network and error handling part of it. This part took probably 20% of the whole development time. I couldn’t find examples on how to handle network errors and saving your progress, so I had to make my own error handling and submitting code. It was very boring, I can tell you. It was fun creating the achievements, though!

The first level in the game

Making the sound effects and music for Flap Flap was great fun. I’d had a tune in my head that I’d been humming along the gameplay, so actually recording the song didn’t take that long. Having a sound studio with microphones and synths already set up made this the quickest and most enjoyable part of making the Flap Flap. The flapping sound of the wings is a studio light umbrella, and the various voices are high-pitched versions of yours truly.

The last weeks of development went into some final refactoring of certain parts of the code. I made a late decision to keep the game speed constantly ramping up, so I needed to go back and change parts of my game engine. I also spent a lot of time play testing and tweaking certain aspects of the game difficulty. I tested the games on three different devices and had to do some more work to keep it from crashing on the first generation iPhone. But in the end I had to say to myself that the game was finished and that no more features should be added at this time.

Now I’m just hoping the game gets approved. It’s going to be interesting to see how it compares to my other app sales-wise. I think I’ve reached my goals of keeping the game simple, fun and challenging and giving it the maximum amount of polish I could do. I think I’ve made something that many people would enjoy, and I hope it doesn’t drown in the sea of thousands of games.

And of course there are features I would like to have added in the game – but hey, isn’t that what updates are for?

Please check out my game and tell me what you think! Itunes link

Some conclusions after this far too long ramble:
- Sticking with a simple idea that I knew I could pull off was VITAL
- Making a quick, ugly prototype of the game made me realize the game mechanic would work
- Spending time on making things look and sound great was time well spent, as coding in itself often sucks (while drawing monsters is fun!)
- Testing often, on real devices and showing it to friends gave important feedback
- Every time you change something integral in your game mechanic, consequenses roll through your code like a tidal wave of poo
- Making a game and seeing it through is extremely gratifying
- Memory management is a bitch

Software used for making Flap Flap:
- Anime Studio for all character animation
- Particle Designer for all particle effects
- TexturePacker for making sprite sheets
- ArtRage for painting backgrounds
- Logic and various synths and studio equipment for audio

Share this post with your friends:
This entry was posted in Uncategorized. Bookmark the permalink.

7 Responses to No pain, no game – making your first iPhone game

  1. marcotronic says:

    Hi,
    thanks for posting this interesting article. Your game is really looking great and very polished! Good luck and much success on the app store. I´m sure you´re gonna sell quite a bunch of copies!

    Marco

  2. Thanks Marco! :)

    Mattis

  3. Kudos and Thanks for making the game and writing this article. It is a good read and while being honest (it is damn hard to make a game parallel to your dayjob) it also is very much inspiring! I’ll check your game out …

    • Thanks Dietmar,

      For sure one of the biggest challenges of creating something is finding the time between a day job and family life.

      I guess my next projects will probably take longer, or I’ll try to keep them as simple as possible. Spare time working is a balancing act! :)

  4. Steve says:

    Great post and good job on your app.
    On an unrelated note interesting to see your tool set min is pretty much identical.
    Artrage for any natural media Great app
    Blender *free for any 3d usually rendered out to 2d. Although with cocos3d out now.?
    Anime studio pro for 2d animation
    Inkscape *free for any general vector based stuff AS PRO can’t handle
    Nanostudio iPhone app for all music. Yes iPhone app. Lol it’s awesome
    Audacity *free for sound editing

  5. PW says:

    Nice trailer. What software did you use to make that? I’m currently pondering on how to create one for my upcoming game.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>