这是三个动作的分解 :运行一个spawn 就可以合成 完整的动画
float fromtime, roTime;
float fAngle1, fAngle2;
fromtime= 10;//叶子下落的时间
roTime = 2.5;//叶子单向摆动一次时间
fAngle1 = -80;//叶子逆时针摆动角度
fAngle2 = 80;//顺时针摆动角度
int iRandPos = rand() % 250;
CCLog("Pianyi%d", iRandPos);
//叶子所运动到的位置
CCMoveTo *moveTo = CCMoveTo::create(10,ccp(CCDirector::sharedDirector()->getWinSize().width - iRandPos, 30));
CCRotateBy *rotaBy1 = CCRotateBy::create(roTime, fAngle1);
CCRotateBy *rotaBy2 = CCRotateBy::create(roTime, fAngle2);
CCEaseInOut *ease1 = CCEaseInOut::create(rotaBy1, 3);
CCEaseInOut *ease2 = CCEaseInOut::create(rotaBy2, 3);
//摆动动作合成
CCFiniteTimeAction *seq2 = CCSequence::create(ease1, ease2, NULL);//依次执行顺时针、逆时针摆动
CCRepeat *baidong = CCRepeat::create(seq2, -1);//摆动合成
CCOrbitCamera * orbit = CCOrbitCamera::create(8, 1, 0, 0, 360, 45, 0);
//让树叶精灵始终执行三维翻转的动作
CCRepeat *fz3d = CCRepeat::create(orbit, -1);//无限循环执行叶片翻转的动作
CCSprite *star =CCSprite::create("star.png");
star->setPosition(ccp(200, 200));
star->runAction(fz3d);
addChild(star);