So, here’s how to easily create your own prototype-based classes in JavaScript. Seems confusing to lots of folks, and there are multiple ways to do it. If you use CoffeeScript, you can write your classes in a more traditional OO style. However, it’s really not too complicated in plain JavaScript. Step One: Write Your Constructor [...]
Category Archives: Programming
Object-oriented programming with JavaScript · September 10, 2012
RequireCS project boilerplate on GitHub · August 16, 2012
So I finally got around to creating a repository on GitHub. I thought it might be useful for others to see the project structure I used to build Shikaku Madness, so I ripped out most of the guts and uploaded it. It uses Backbone for structure, and loads dependencies using RequireJS. I also used James [...]
Experimenting with Javascript · June 26, 2012
In my last post I complained about dealing with all the static images that one has to create in order to support multiple iOS device resolutions. I was just getting so frustrated dealing with layouts that required 3 different static images, and having to jump through hoops whenever I wanted to display some sort of [...]
cocos2d + Game Center Achievements · November 1, 2011
If you’ve been following along on the blog, I posted a few months ago about how to easily integrate Game Center leaderboards into your cocos2d game. Game Center is pretty great, because Apple writes basically all of the code for you, and they also provide a web-based interface to create your content. My previous tutorial [...]
cocos2d + Game Center · July 13, 2011
So (for those of you who have been living under a rock) Apple has baked a “social” gaming service for iOS into recent releases called Game Center. Game Center allows its’ users to see what games their friends are playing, as well as their own progress in the Game Center-enabled games they own. For developers, [...]
NS(Mutable)Array tips · June 1, 2011
The game I’m currently working on is a color-matching game, where the puzzle tiles are arranged on a grid. Obviously, the data structure you’d use for such a game is an array. While you could use a regular C array, NSMutableArray has a few advantages. It’s true that NSArray/NSMutableArray are slower than regular C arrays, [...]
cocos2d Game Tutorial – Multitouch Asteroids (Part 3) · March 9, 2011
Hey, welcome back to yet another installment of the “multitouch asteroids” tutorial series. If you haven’t been following along, you can always go back and review part one or part two. This tutorial will focus on fleshing out the asteroids-style game that we created, including making both a title scene and “how to play” scene, [...]
How to Save Data with NSUserDefaults · February 13, 2011
A common requirement for any sort of computer program is saving data. In iOS, probably the simplest way of saving information about your app is using NSUserDefaults. In a nutshell, NSUserDefaults is a dictionary that will automatically save and load its’ state when your app opens and closes. I’ve used the NSUserDefaults class to save [...]




