26#include "../testResource.h"
35ClickAndMoveTest::ClickAndMoveTest()
42 auto listener = EventListenerTouchOneByOne::create();
45 _eventDispatcher->addEventListenerWithSceneGraphPriority(listener,
this);
49 auto layer = LayerColor::create(Color4B(255,255,0,255));
53 sprite->setPosition(20,150);
55 sprite->runAction( JumpTo::create(4, Vec2(300,48), 100, 4) );
57 layer->runAction( RepeatForever::create(
72 auto location = touch->getLocation();
76 s->runAction( MoveTo::create(1, Vec2(location.x, location.y) ) );
77 float o = location.x - s->getPosition().x;
78 float a = location.y - s->getPosition().y;
79 float at = (float) CC_RADIANS_TO_DEGREES( atanf( o/a) );
89 s->runAction( RotateTo::create(1, at) );
#define ADD_TEST_CASE(__className__)
bool onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *event)
void onTouchEnded(cocos2d::Touch *touch, cocos2d::Event *event)
static const char s_pathGrossini[]