此代码有效:
cocos2d::MoveBy* action = myCreateAction();
cocos2d::Animate* animation = myCreateAnimation();
cocos2d::Spawn* moving = cocos2d::Spawn::createWithTwoActions(action, animation);
runAction(moving);
此代码也有效,但动画比动作长,因此动作是不连续的:
cocos2d::MoveBy* action = myCreateAction();
cocos2d::Animate* animation = myCreateAnimation();
cocos2d::Spawn* moving = cocos2d::Spawn::createWithTwoActions(action, animation);
runAction(cocos2d::RepeatForever::create(moving));
如果我运行此代码:
cocos2d::RepeatForever* action = cocos2d::RepeatForever::create(myCreateAction());
cocos2d::RepeatForever* animation = cocos2d::RepeatForever::create(myCreateAnimation());
cocos2d::Spawn* moving = cocos2d::Spawn::createWithTwoActions(action, animation);
runAction(moving);
什么都没发生。为什么呢?