为什么cocos2d中的cocos2d :: RepeatForever :: Spawn不起作用?

时间:2015-06-23 15:18:06

标签: c++ cocos2d-x cocos2d-x-3.0

此代码有效:

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);

什么都没发生。为什么呢?

0 个答案:

没有答案