Updated for Cocos2d V2.