- #ifndef__HELLOWORLD_SCENE_H__
- #define__HELLOWORLD_SCENE_H__
- #include"cocos2d.h"
- usingnamespacecocos2d;
- classHelloWorld:publiccocos2d::CCLayerColor
- {
- public:
- //Method'init'incocos2d-xreturnsbool,insteadof'id'incocos2d-iphone(anobjectpointer)
- virtualboolinit();
- //there'sno'id'incpp,sowerecommendtoreturntheclassinstancepointer
- staticcocos2d::CCScene*scene();
- //aselectorcallback
- voidmenuCloseCallback(CCObject*pSender);
- //preprocessormacrofor"staticcreate()"constructor(node()deprecated)
- CREATE_FUNC(HelloWorld);
- voidaddTarget();
- voidspriteMoveFinished(CCNode*sender);
- voidgameLogic(cocos2d::CCTimedt);
- voidccTouchesEnded(CCSet*touches,CCEvent*event);
- CCArray*aarayTarget;//敌人
- CCArray*arrayProjectile;//飞镖
- voidupdate(CCTimedt);
- };
- #endif//__HELLOWORLD_SCENE_H__
HelloWorldScence.cpp