Updated for Cocos2D 2.1