Some code for cocos2d-x