the useful code of cocos2d-x