test code based on cocos2dx