代码如下:
HelloWorldScene.h #ifndef __HELLOWORLD_SCENE_H__ #include "cocos2d.h" // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone // a selector callback bool onContactBegin(const PhysicsContact& contact); CREATE_FUNC(HelloWorld); #endif // __HELLOWORLD_SCENE_H__ |
报错:
Error 4 error C2061: syntax error : identifier 'Touch' (..\Classes\AppDelegate.cpp) e:\cocos2d-x\samples\hello\classes\helloworldscene.h 19 1 hello |
解决方法:
在行#include "cocos2d.h"下增加如下代码行:
USING_NS_CC;