Cocos2D and Storyboards

UPDATE: I’ve now uploaded a ready-to-use class for your enjoyment to GitHub.

Storyboarding in iOS 5 is really neat. It allows you to lay out nearly your entire interface visually, and gives you some neat features that simply make your life as a developer easier. Since our next game (an RPG) is going to be extremely UI-heavy, naturally we wanted to use Storyboarding to create our interface. The problem comes when it’s time to fire up Cocos2D and display our battle scenes.

However, with Cocos2D 2.0 (the OpenGL ES 2.0 version) and iOS 5′s view controller containment functionality, integrating Cocos2D in a Storyboard is actually very trivial.

(more…)

Comments ( 1 )

Here’s the Plan

In my last post, I listed my 2012 indie game dev resolutions. So far, things have been going well. I’m working on the game that I want to make, and it looks like I’ll be able to finish it this year (in fact, more likely within the first half of this year). The only bit that hasn’t gone so well is “being more social”. My plan was to go to GDC this year and chat with other iOS developers, but due to my day job I won’t be able to make it this year. Oh well, there’s always WWDC.

There was a bit of a setback on progress as my daughter, my wife, and myself all got the nasty stomach virus that’s been sweeping across the country lately. While it was only a 24-hour illness, recovery took quite a bit longer. However, unlike before when I would have a break in development and have trouble getting started again, I was able to jump right back into it once I was able. How was I able to accomplish this seemingly impossible task?! Why, through planning, of course!

(more…)

Comments ( 1 )

New Year’s Resolutions

So it’s been a while since I’ve written anything for #iDevBlogADay, or indeed this blog in general. But it’s a brand new year, and thus a chance for new beginnings!

This post is going to be about my indie game development New Year’s Resolutions; three things that I’ve resolved myself to doing in 2012 for Tiny Tim Games. If nothing else, it’ll give a sense of where I would hopefully like to go this year, and also possibly motivate you to make your own indie game dev resolutions.

(more…)

Comments ( 3 )

Unity Plugins and UIApplicationDidFinishLaunchingNotifcation

I’m taking a break from my Cocos2D-related posts for this #iDevBlogADay entry. With that said, while this post will be talking specifically about creating Unity plugins, the knowledge can still be used to aid in creating standalone plugins for Cocos2D as well.

So you’re writing your Unity plugin to do some cool native functionality, but you really need it to do some work right when the app launches. There are usually two ways to solve this problem: 1) Create an “init” function that you call from Unity script when your first scene is loaded, or worse 2) modify application:didFinishLaunchingWithOptions: directly. Technically, there’s a third option too, involving creating a category of the AppController delegate and “overriding” application:didFinishLaunchingWithOptions:. The OpenFeint Unity plugin uses this method, actually, but as I mentioned in a previous post, this has some serious drawbacks, especially if you want to use the technique more than once (and yes, I realize I’m the one who originally wrote that plugin… I didn’t know!).

I’d like to introduce you to the UIApplicationDidFinishLaunchingNotification key, something which has become a good friend of mine.

(more…)

Comments ( 0 )

Extending CCNode

If  you’re using Cocos2D, for the most part you’ll be using CCSprite and other CCNode-derived classes as is. If you need to make extensions to these classes, you simply make a subclass derived from those classes and write only what you need.

But what if you need to extend CCNode itself? You could subclass CCNode, but then CCSprite and other subclasses wouldn’t get the benefits of your subclass. You could modify the CCNode source code, but if you update to a future version of Cocos2D, you’re likely to run into merge problems or (worse) lose all of your changes.

This is where we can leverage the fact that Cocos2D is written in Objective-C. The language provides lots of excellent features that allow us to extend a pre-existing class without subclassing.

(more…)

Comments ( 0 )
Page 1 of 612345...Last »