axmol/Cocos2dSimpleGame/logic/HelloWorldScene.h

43 lines
979 B
C
Raw Normal View History

#ifndef _HELLOWORLD_LAYER_H_
#define _HELLOWORLD_LAYER_H_
#include "cocos2d.h"
class HelloWorld : public cocos2d::CCColorLayer
{
protected:
cocos2d::NSMutableArray<cocos2d::CCSprite*> *_targets;
cocos2d::NSMutableArray<cocos2d::CCSprite*> *_projectiles;
int _projectilesDestroyed;
public:
HelloWorld();
virtual ~HelloWorld();
// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
virtual bool init();
2010-10-09 09:58:27 +08:00
void addTarget();
void ccTouchesEnded(cocos2d::NSSet* touches, cocos2d::UIEvent* event);
// callfunc callback
void spriteMoveFinished(cocos2d::CCNode* sender);
// scehdule selector, timer
void gameLogic(cocos2d::ccTime dt);
// update
void update(cocos2d::ccTime dt);
2010-10-09 09:58:27 +08:00
// a selector callback
void menuCloseCallback(cocos2d::NSObject* pSender);
LAYER_NODE_FUNC(HelloWorld);
2010-10-18 10:38:19 +08:00
static cocos2d::CCScene* scene();
};
#endif // _HELLOWORLD_SCENE_H_