Tools I used to create a simple iOS game

My latest iOS app, Shape Matcher, was recently released into the wild. It’s an iOS (available on iPad and iPhone) shape matching game for young kids’ – about all the gaming logic I can handle as a night-time Obj-c novice. Anyway, I figured it might be useful to others if I documented what software, frameworks and tutorials I used to develop it.

Shape Matcher

Software

  1. Inkscape

    Inkscape is an awesome open source vector graphics editor. One of the things about writing a game is that you’ll probably need to draw some cute backgrounds or characters. Unless you’re a designer who already owns a copy of and knows how to use something like Illustrator or Photoshop, you’re going to want this software.

    Drawing itself is a skill I don’t really have, and that really sucks. These days, apps have to look as good as they work. I might be good at writing software but I’m really not very good at drawing stuff – or at least that is what I was convinced of until Jas and I finally sat down and tried to learn how to draw digitally. We followed a fantastic tutorial called 2D Game Art For Programmers – Part 1 and by the end of it, we weren’t too bad at drawing some nice scenes and basic characters. All it took was for us to sit down and actually put our minds to it and it turns out that we’re not that bad at drawing after all!

  2. Zwoptex

    If you plan on including lots of images in your iOS game, you might find it easier to use sprite sheets instead of lots of individual images. This is especially true if you plan on supporting different devices with different resolutions (because you need to supply resized images for each differently sized device). Zwoptex is a tool that allows you to create sprite sheets from your original images. You can then use Cocos2D’s built-in support to load the sprite sheets in your game. You can download Zwoptex for free, and if you don’t purchase it, it will take a couple of seconds longer to export the sprite sheets but it will still work properly otherwise. Much recommended!!

  3. Sublime Text

    There seems to almost be a little bit of a cult following around Sublime Text. I’ve heard lots of well-known developers say that they use it as their primary code editor. It does seem to be nice and fluent. There are a few things about the UI that make it stand out. I use it when needing to copy plist values from the temporary files that Zwoptex outputs to my app ones. It certainly does the trick.

  4. GarageBand

    Most games have some sort of sound effects or soundtrack. Luckily cocos2d, the gaming framework I use, allows you to include sounds in your game really easily. But you still need to make your sounds or edit open source ones you find online. GarageBand provides a nice interface to do just this. You can then export them as .mp3 files and include them in your Xcode project. Simple!

Frameworks

  1. cocos2d for iPhone

    cocos2d for iPhone is a framework for building 2D games. It adds support for important gaming functionality like transitions between scenes, sprites and sprite sheets, effects and actions, menus and sound… just to name a few. Shape Matcher is the second iOS game using cocos2d that I’ve worked on. Earlier this year, Jas and I wrote and released Easter Egg Hunt, also using cocos2d. So far we are both very happy with the framework as it provides a lot of functionality that I wouldn’t want to try and write from scratch. The only criticism I have right now is that the latest stable version, cocos2d-iphone-2.0, does not have support for the new iPhone 5 Retina Display screen resolution. Version cocos2d-iphone-2.1 beta3 does, but it’s still in beta. Either way, you can get around it in code if you need to.

  2. Localytics

    Localytics offers integrated app analytics for your apps. They have an iOS library that you download and link to in your app. You can then track certain events in your app, such as when a user clicks a particular button or when they’ve spent a particular amount of time on any one scene. This information can be truly invaluable and the Localytics library makes it super easy to use. Their website, where you can view graphs about your app’s usage, is easy to navigate and nicely responsive. They aren’t free but they offer a free trial that doesn’t end, as far as I know. You have to pay to access some of the more interesting reports.

  3. In-App Purchases

    Although it can take months to write even a semi-decent iOS game, most people aren’t prepared to part with even $0.99 USD for it. I’m not quite sure I’m prepared to spend hours upon hours writing games that don’t make me a cent in return, but I would like people to actually play my games! In terms of games, this is where In-App Purchases come in very handy. You can put your game on the App Store for free, but sell extra scenes or options from within the game itself.

    Luckily, Apple has made it pretty easy to integrate In-App Purchases in your application and theres a ton of help on the internet on how to use it. I used one of Ray Wenderlich’s awesome tutorials, Introduction to In-App Purchases, to learn how to include some in-app purchases in my game.

Tips and tricks

Below are a few more little tips and tricks to help you get going.

Localytics

It’s a good idea to create both ‘test’ and ‘live’ versions of your app on Localytics so you can test your integration with them and not pollute your ‘live’ analytics. Just before you archive and submit your app to be reviewed, change the Localytics app ID in your code to the ‘live’ one. Don’t forget to do this!!

In-App Purchases

Although I totally missed it in the Apple documentation, apparently if you have any In-App Purchases in your app, you must provide a ‘Restore Purchases’ button in case the user installs your app on a new phone and has already made purchases. This button seems somewhat overkill since clicking on the buy button again will allow the user access to the purchase without charging them again but I guess it’s nicer for the user to click on a ‘restore’ button than a ‘purchase’ button. Apple app review staff will reject your app if you don’t provide this button. Ask me how I know this…

Zwoptex

When creating the individual images that you’ll use in your game, export them in the largest size you’ll need them from Inkscape. Import them into Zwoptex to create a sprite sheet and save this workspace. You can then set up the publish settings to export one sprite sheet for each device resolution you want to support (except for the iPhone 5 that actually has a different ratio). When you press the ‘publish’ button, Zwoptex will create a spreadsheet per setting. This saves a lot of time when you’re writing a universal iOS game and keep making subtle changes to your drawings.

Zwoptex Example

Below is a handy table of iOS device sizes that you’ll want to use in your publish settings for each iOS device:

iPad Retina 100%
iPad 50%
iPhone Retina 46.875%
iPhone 23.4375%

So what are you waiting for? Go download these tools and get started on your first iOS game! If you have any questions, please feel free to ask :)

If you liked this post, share it!
Facebook Twitter Linkedin Delicious Digg Stumbleupon Email

6 thoughts on “Tools I used to create a simple iOS game

  1. Hi Annie

    Great post! We’re going to be starting on some iPad development this year. As you’re someone with a solid C# background, I’d be interested to hear if you considered using MonoTouch from Xamarin. If you did, what were your reasons for going with Objective-C instead?

    Thanks

    Sean

    • Hi Sean!

      That’s quite an interesting question. This is a topic I’ve had quite a few discussions about.

      At the end of the day, it’s all about opportunity cost and risk management. My feelings are that if you can realistically learn the proprietary language / syntax / framework within the time frame you have, that’s got to be the best way to go. That way, you won’t have to deal with missing functionality because Xamarin hasn’t caught up yet. What happens if Xamarin go out of business and stop supporting MonoTouch – no more updates? You won’t have to deal with weird bugs that have been introduced by the MonoTouch framework (not saying it had but no software is bug free!). You’ll be able to get all the support you need from Apple, which you may not have been able to get if you use a third party framework. You can use any libraries written for iOS (like cocos2d or the Facebook SDK) which I’m not sure you could if you were using MonoTouch. You should be able to find heaps of resources and code snippets on the Internet to help you solve most issues, as Obj-C has been around a lot longer and been used / tested a lot more than MonoTouch. And last but not least, MonoTouch costs a fair chunk of money over and above your Apple Developer subscription, ouch!

      With that all said, it is definitely worth considering if you have no experience with Obj-C and you have a short amount of time in which to get your app written. It might also make more sense if you’re planning to release an Android or Windows version of the same app. I’ve heard good things about MonoTouch although I personally haven’t given it a go. Obj-C syntax is quite funky (although I have seen worse!) and memory management can be tricky, but it’s not magic and there are plenty of tools to help.

      I hope that helps answer your question! :)

      • @Annie:

        Hi Annie

        That’s a great insight into your thinking around this, thank you for that.

        Regarding continued support by Apple, yes, you’re right on the money there. There’s no guarantee that Apple won’t be come back with another Clause 3.3.1 in a later version and that is a real worry for us. Going native does properly shield you from that. Back when 331 was in force, we had decided to skip the iOS platform and we’d probably do that if they reverted back to that stance again. That said, it would be a shame to have to do that.

        I hear what you’re saying about Objective-C too – funky indeed!!

        Many thanks again

        Sean :)

  2. I would like to ask about tool to design life games for kids not software games but it`s life games in real life with hardware component.

  3. hi Annie!

    thank you for the information…

    I was wondering which device size should I use, when I need to publish spreadsheets for iPhone 5 and ipad mini as well as the latest iPad ?

Leave a Reply

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