在cocos2d-x中,我在尝试单独定义一个CCSequence时遇到了如下问题,即不在runAction内。
这有效:
sprWheel1->runAction( CCSequence::actions(
CCDelayTime::actionWithDuration( fDelayTime ),
CCEaseExponentialOut::actionWithAction(
CCRotateBy::actionWithDuration( fMoveTime, fAngle ) ),
NULL
) );
sprWheel2->runAction( CCSequence::actions(
CCDelayTime::actionWithDuration( fDelayTime ),
CCEaseExponentialOut::actionWithAction(
CCRotateBy::actionWithDuration( fMoveTime, fAngle ) ),
NULL
) );
这不起作用:
CCFiniteTimeAction* actRotate = CCSequence::actions(
CCDelayTime::actionWithDuration( fDelayTime ),
CCEaseExponentialOut::actionWithAction(
CCRotateBy::actionWithDuration( fMoveTime, fAngle ) ),
NULL
);
sprWheel1->runAction( actRotate );
sprWheel2->runAction( actRotate );
它不会导致编译器错误、崩溃或任何事情,它只是不会旋转精灵。
我怎样才能解决这个问题?(我多次使用此操作,因此如果我只能定义一次,这将有助于保持我的代码更清晰)