tag archives: programming

Object-oriented programming with JavaScript · September 10, 2012

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 […]

Add a comment · Posted by in Programming · , ,

Resolution Woes · May 9, 2012

Oh, my unbridled naivety! My last post discussed a new game, and how quickly it was coming together. Of course, any project is easy to start, and the real difficulty is dealing with the soul-crushing minor issues that rear their heads when you’re almost done. In my case, dealing with image assets for 3 different […]

1 comment · Posted by in Meta, Programming · , ,

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, […]

20 comments · Posted by in Programming, Tutorial · , , , , ,

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, […]

Add a comment · Posted by in Programming · , , ,

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, […]

22 comments · Posted by in Programming, Tutorial · , , , , ,

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 […]

3 comments · Posted by in Programming, Tutorial · , , ,

Menus and buttons in cocos2d · January 17, 2011

What the what? It’s tutorial time again! This time the subject will be a bit smaller in scope than some of my previous entries: menus and buttons. Buttons are obviously a key ingredient in any game’s UI. While iOS games might not use buttons for actual gameplay, at the very least your game will have […]

5 comments · Posted by in Programming, Tutorial · , , , , , , ,

cocos2d Game Tutorial – Multitouch Asteroids (Part 2) · January 3, 2011

Bokay, so in the previous tutorial we created a good base for an Asteroids-style game — we created a Ship object, and got it to respond to user input. But! There’s no conflict yet, and therefore not much of a game. In this installment we’re going to create Bullet and Asteroid classes, so you can […]

4 comments · Posted by in Programming, Tutorial · , , , , , ,

cocos2d Game Tutorial – Multitouch Asteroids (Part 1) · December 27, 2010

So I’ve posted some general-purpose tutorials about some of the lower level components of cocos2d, and I figure it’s as good of a time as any to have a tutorial that makes something “real.” So, for this next series, we’re going to concentrate on making a full-fledged game – an Asteroids clone. The game logic […]

7 comments · Posted by in Programming, Tutorial · , , , , , ,

Detecting touch events in cocos2d-iphone · December 13, 2010

In the previous tutorial I wrote about scenes and layers, the basic structural classes of a cocos2d app. In this next installment, I’m going to talk about putting some actual content into your scenes and responding to user input. If we’re interested in getting user input, first we should create something that responds to that […]

10 comments · Posted by in Programming, Tutorial · , , , , ,