Size visibleSize = Director::getInstance()->getVisibleSize();
//构造一个精灵
auto role = Sprite::create("grossini.png");
role->setPosition(visibleSize / 2);
addChild(role);
role->setScale(0.5);//减小一倍
role->setScale(2);//放大一倍
//
role->runAction(MoveTo::create(2, Vec2(visibleSize.width-100,visibleSize.height/2)));//2秒时间中向右移动
//多个动作组合
//先向右再向左移动
auto move1 = MoveTo::create(2, Vec2(visibleSize.width - 100, visibleSize.height / 2));
auto move2 = MoveBy::create(2, Vec2(-1000, 0));
role->runAction(Sequence::create(move1, move2, NULL));*/

/*
//先向左移动再返回(反转)
auto move1 = MoveBy::create(2, Vec2(-1000, 0));
auto move2 = move1->reverse();
role->runAction(Sequence::create(move1, move2, NULL));*/

//并列执行
/*
auto move = MoveBy::create(2, Vec2(600, 0));
auto scale = ScaleTo::create(2,1);
role->runAction(Spawn::create(move, scale, NULL));*/
//执行完的回调(打印over)
role->runAction(Sequence::create(Spawn::create(move, scale, NULL), CallFunc::create([](){
log("over");
}), NULL));