2010-08-25 17:02:58 +08:00
|
|
|
#ifndef _MOTION_STREAK_TEST_H_
|
|
|
|
#define _MOTION_STREAK_TEST_H_
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
////----#include "cocos2d.h"
|
|
|
|
#include "../testBasic.h"
|
2013-06-07 08:12:28 +08:00
|
|
|
#include "../BaseTest.h"
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2012-06-14 05:19:13 +08:00
|
|
|
//USING_NS_CC;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-07 08:12:28 +08:00
|
|
|
class MotionStreakTest : public BaseTest
|
2010-08-25 17:02:58 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
|
|
|
MotionStreakTest(void);
|
|
|
|
~MotionStreakTest(void);
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2014-02-20 10:53:49 +08:00
|
|
|
void restartCallback(Ref* sender);
|
|
|
|
void nextCallback(Ref* sender);
|
|
|
|
void backCallback(Ref* sender);
|
|
|
|
void modeCallback(Ref* sender);
|
2012-03-22 14:32:32 +08:00
|
|
|
protected:
|
2013-06-20 14:17:10 +08:00
|
|
|
MotionStreak *streak;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class MotionStreakTest1 : public MotionStreakTest
|
|
|
|
{
|
|
|
|
protected:
|
2013-06-20 14:17:10 +08:00
|
|
|
Node* _root;
|
|
|
|
Node* _target;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(MotionStreakTest1);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2012-06-12 01:43:07 +08:00
|
|
|
void onUpdate(float delta);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class MotionStreakTest2 : public MotionStreakTest
|
|
|
|
{
|
|
|
|
protected:
|
2013-06-20 14:17:10 +08:00
|
|
|
Node* _root;
|
|
|
|
Node* _target;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(MotionStreakTest2);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2013-09-03 18:22:03 +08:00
|
|
|
void onTouchesMoved(const std::vector<Touch*>& touches, Event* event);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
2012-06-12 16:56:34 +08:00
|
|
|
class Issue1358 : public MotionStreakTest
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(Issue1358);
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2012-06-12 16:56:34 +08:00
|
|
|
virtual void update(float dt);
|
|
|
|
private:
|
2014-05-15 01:07:09 +08:00
|
|
|
Vec2 _center;
|
2013-06-15 14:03:30 +08:00
|
|
|
float _radius;
|
|
|
|
float _angle;
|
2012-06-12 16:56:34 +08:00
|
|
|
};
|
|
|
|
|
2010-08-25 17:02:58 +08:00
|
|
|
class MotionStreakTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
//CCLayer* nextAction();
|
|
|
|
|
|
|
|
#endif
|