2013-06-04 17:38:43 +08:00
|
|
|
#ifndef __CC_SceneController_H__
|
|
|
|
#define __CC_SceneController_H__
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
2013-10-16 16:48:39 +08:00
|
|
|
#include "extensions/cocos-ext.h"
|
2016-03-21 21:04:06 +08:00
|
|
|
#include "editor-support/cocostudio/CocoStudio.h"
|
2013-06-04 17:38:43 +08:00
|
|
|
|
2013-10-15 18:00:03 +08:00
|
|
|
class SceneController : public cocostudio::ComController
|
2013-06-04 17:38:43 +08:00
|
|
|
{
|
|
|
|
protected:
|
2015-04-03 14:31:03 +08:00
|
|
|
SceneController();
|
|
|
|
virtual ~SceneController();
|
2013-06-04 17:38:43 +08:00
|
|
|
|
|
|
|
public:
|
2013-11-14 13:28:42 +08:00
|
|
|
virtual bool init() override;
|
2015-06-04 14:06:31 +08:00
|
|
|
virtual void onAdd() override;
|
|
|
|
virtual void onRemove() override;
|
2013-11-14 13:28:42 +08:00
|
|
|
virtual void update(float delta) override;
|
2013-06-04 17:38:43 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
static SceneController* create();
|
2013-06-04 17:38:43 +08:00
|
|
|
|
|
|
|
public:
|
2013-12-28 14:34:52 +08:00
|
|
|
cocos2d::Vector<cocos2d::Node*>& getTargets() {return _targets;};
|
|
|
|
cocos2d::Vector<cocos2d::Node*>& getProjectiles() {return _projectiles;};
|
|
|
|
void spriteMoveFinished(cocos2d::Node* sender);
|
|
|
|
void increaseKillCount();
|
|
|
|
|
|
|
|
void addTarget();
|
|
|
|
float _fAddTargetTime;
|
|
|
|
float _fElapsedTime;
|
2013-06-04 17:38:43 +08:00
|
|
|
|
|
|
|
protected:
|
2013-12-28 14:34:52 +08:00
|
|
|
cocos2d::Vector<cocos2d::Node*> _targets;
|
|
|
|
cocos2d::Vector<cocos2d::Node*> _projectiles;
|
2013-06-04 17:38:43 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // __FUNDATION__CCCOMPONENT_H__
|