//在CCSequence中插入CCReapeatForever
CCFiniteTimeAction* action = CCSequence::create(
CCDelayTime::create(1),
CCCallFuncN::create( this, callfuncN_selector(ActionRepeatForever::repeatForever)),
NULL);
void ActionRepeatForever::repeatForever(CCNode* pSender){CCRepeatForever *repeat = CCRepeatForever::create( CCRotateBy::create(1.0f, 360) );
// CCActionInterval* rep1 = CCRepeat::create(seq, 10);//循环10次
pSender->runAction(repeat);}
//在CCReapeatForever中插入CCSequence
CCActionInterval* act1 = CCRotateTo::create(1, 90);
CCActionInterval* act2 = CCRotateTo::create(1, 0);
CCActionInterval* seq = (CCActionInterval*)(CCSequence::create(act1, act2, NULL));CCAction* rep1 = CCRepeatForever::create(seq);
cocos2d-x之ActionRepeatForever
最新推荐文章于 2021-03-30 14:20:38 发布