auto hero=Sprite::create("hero_2.png");
hero->setPosition(Vec2(100, 100));
addChild(hero);
hero->setTag(100);
//*******************移动*********************
// MoveTo 移动到的位置,该位置是相对于屏幕左下角
auto moveTo=MoveTo::create(2.0f, Vec2(600, 500));
// MoveBy 移动的矢量距离,在hero的原来位置的基础上
auto moveBy=MoveBy::create(2.0f, Vec2(600, 500));
//hero->runAction(moveTo);
//hero->runAction(moveBy);
//********************************************/
/*******************旋转*********************/
auto rotateTo=RotateTo::create(2.0f, 90);
auto rotateBy=RotateBy::create(2.0f, 90);
//hero->setRotation(30);
//hero->runAction(rotateBy);
/*******************缩放*********************/
auto scaleTo=ScaleTo::create(5, 2);
auto scaleBy=ScaleBy::create(5, 2);
//hero->runAction(scaleBy);
/*******************跳跃*********************/
auto jumpTo=JumpTo::create(2.0, Vec2(500, 400), 80, 4);
auto jumpBy=JumpBy::create(2.0, Vec2(500, 300), 100, 4);
// hero->runAction(jumpTo);
// hero->runAction(jumpBy);
// 系列动作
auto queue=Sequence::create(jumpTo,scaleTo,rotateBy,NULL);
hero->runAction(queue);
1522

被折叠的 条评论
为什么被折叠?



