Updated to work with cocos2d 2.0
Thanks to Scott West for some of the changes