Paul Warren, an alumni of the Cocoa and iPhone Studios, recently released his iPhone puzzle game called SWIZZLE. When I first saw it, I was blown away by the gorgeous animations and custom controls. It's a clever game, too! I asked Paul to share his thoughts on developing games for the iPhone.

How did you get started developing games for the iPhone?

Having spent 20 years as a corporate software developer (mostly in assembler), my plan had been to develop software for the Mac. I'd been learning Cocoa and attended the Pragmatic Studio Cocoa training course here in Denver. One of the teachers was Bill Dudney and he suggested (somewhat tongue-in-cheek) that we all drop everything and start developing iPhone apps. He mentioned something about it being "lots of fun and a chance to make some money". So that night I changed plans—it's all Bill's fault!

Initially I considered writing a utility app, but the idea of a simple game was appealing. The only problem was I hadn't written a game since I first taught myself assembler on a Commodore 64 (remember those?). Curiously, the C64 had hardware "sprites" which were great for games. And that's probably why I liked playing with Core Animation layers on the iPhone so much. There's a lot of overlap between sprites and layers, but layers are much more powerful.

SWIZZLE feels like a unique puzzle game. Where did you come up with the idea for it?

While struggling to sleep that night, I tried to think of something that would be a great fit for the iPhone and its touch interface. Swiping seemed so natural on the device and that got me thinking of a swipe that creates a flip effect. And if you can flip horizontally, then why not vertically. That way, pieces could move around.

So I got up early (3 am) and coded up a basic version of the app for the Mac just to see if it would work. It didn't have any animation, just the flip results. I could see that the puzzle was tricky to solve, but not quite difficult enough. Then I added diagonals and it started to get very cool. The diagonal flipping on the iPhone really surprised me. I thought I had messed up because tiles turned sideways. But I realized that not only did it look cool, it also gave the correct result and added significantly to the challenge.

It's easy to start playing, but also gets quite challenging. What level are you proficient up to?

I can play them all now, though level 7 is challenging even for me. I've learned a lot of tricks over months of testing. I might make some tips and tricks videos to pass on some of those techniques!

Did you have a specific audience in mind for SWIZZLE?

Puzzlers, Rubik's Cube players, and anyone who likes a challenge. Even kids can play the 2x2 level and get a sense of the how the tiles move around. It can look a little intimidating at first, but I think almost anyone can play and hopefully start to get hooked.

Did you study the underlying puzzle mathematics (dihedral groups)?

Ha! Not really. I studied Math and Computer Science at college, but didn't do any additional research for SWIZZLE. But you never know what concepts stick there in the back of your mind.

It's obvious just looking at SWIZZLE that you really sweated the details. Is there anything you're especially proud of?

The custom controls on the selection screen took a lot of work to get right. The idea was always to have the player select the puzzle from a large set of numbers, but I hate having to type in a numbers. The Apple controls didn't really fit the design, so I set about creating my own combination lock wheels.

Most people seem to think they are done in OpenGL, but it's actually a set of transformed CALayers. In fact, the entire game is done with layers and Core Animation. The animation of the rows and columns was pretty straight forward, but the diagonals were tough to get right. I learned that sublayer transforms can provide a powerful animation grouping effect.

How did you know when the game was ready to be released?

This is one of the toughest areas. Any good programmer will tell you that his app is never finished. There are always new features you can add or improvements to game play and feel, but you need to draw a line. I spent way too long "tuning" the animations to look just right when I probably would have been better served by using the 80-20 rule, especially for the first release.

In the end I simply decided on a list of features that would make a complete game but not take another year to code and tune. Even then, I could have spent a lot of time tweaking features, images, and especially animations. But I set a date to complete it and pretty much stuck to it. I missed the self-imposed deadline only by a few days to resolve a couple bugs. My wife insisted only I would have noticed them. :-)

What are you hoping to add in the next version of SWIZZLE?

Facebook and Twitter integration seem very popular right now and obviously have promotional advantages, too. I'd like to add some integrated training to get over the initial learning curve and hopefully get people hooked. One idea would be to hard code the first 10 games on the early levels to provide a progressive level of difficulty. Images on the tiles are another option, but diagonals would make it far too difficult.

What advice would you give folks who are getting into iPhone game development?

Do not give up your day job. It's a VERY hard market to crack and the competition is intense. Most games require a significant investment in development time, even apparently simple ones like SWIZZLE. Games often only provide a small return unless they break into the top 10 list or are exceptionally well promoted. If you do decide to give it a try, be prepared to work really hard and sweat the details. Users can tell very quickly if something has been rushed or shortcuts have been taken.

Now that SWIZZLE is on the App Store, can you tell us what you're planning to work on next?

The Apple developer community is extremely supportive and I want to to give something back. I'm planning to create some screencasts in the areas where I have built up expertise, especially in the area of Core Animation, layers, and custom controls. There's a lot of potential there for creating an application with a unique look and feel, yet still be intuitive for iPhone users.

Thanks, Paul, and congrats on releasing SWIZZLE!

You can check out SWIZZLE in the App Store and support Paul's work for only $1.99.

Ready to create your own iPhone game? Consider joining us in Long Beach in December for the next iPhone SDK Studio!