// 动作:色彩渐变
CCTintTo* tint1 = [CCTintToactionWithDuration:2 red:255 green:0 blue:0];
CCTintTo* tint2 = [CCTintToactionWithDuration:2 red:255 green:255 blue:0];
CCTintTo* tint3 = [CCTintToactionWithDuration:2 red:0 green:255 blue:0];
CCTintTo* tint4 = [CCTintToactionWithDuration:2 red:0 green:255 blue:255];
CCTintTo* tint5 = [CCTintToactionWithDuration:2 red:0 green:0 blue:255];
CCTintTo* tint6 = [CCTintToactionWithDuration:2 red:255 green:0 blue:255];
CCSequence* tintSequence = [CCSequenceactions:tint1, tint2, tint3, tint4, tint5, tint6, nil];
CCRepeatForever* repeatTint = [CCRepeatForeveractionWithAction:tintSequence];
[gameOver runAction:repeatTint];
// 动作:转动、颤动
CCRotateTo* rotate1 = [CCRotateToactionWithDuration:2 angle:3];
CCEaseBounceInOut* bounce1 = [CCEaseBounceInOutactionWithAction:rotate1];
CCRotateTo* rotate2 = [CCRotateTo actionWithDuration:2angle:-3];
CCEaseBounceInOut* bounce2 = [CCEaseBounceInOutactionWithAction:rotate2];
CCSequence* rotateSequence = [CCSequenceactions:bounce1, bounce2, nil];
CCRepeatForever* repeatBounce =[CCRepeatForever actionWithAction:rotateSequence];
[gameOver runAction:repeatBounce];
// 动作:跳动
CCJumpBy* jump = [CCJumpBy actionWithDuration:3position:CGPointZero height:screenSize.height / 3 jumps:1];
CCRepeatForever* repeatJump = [CCRepeatForeveractionWithAction:jump];
[gameOver runAction:repeatJump];
// 标签:点击游戏开始
CCLabel* touch = [CCLabellabelWithString:@"tap screen to play again"fontName:@"Arial" fontSize:20];
touch.position = CGPointMake(screenSize.width /2, screenSize.height / 4);
[self addChild:touch z:100 tag:101];
// 动作:闪烁
CCBlink* blink = [CCBlink actionWithDuration:10blinks:20];
CCRepeatForever* repeatBlink = [CCRepeatForeveractionWithAction:blink];
[touch runAction:repeatBlink];
}
//动作:放大
CCScaleTo* scaleUp = [CCScaleTo actionWithDuration:CCRANDOM_0_1() * 2 + 1 scale:1.05f];
//速度渐变动作:速度由慢至快,再由快至慢
CCEaseBackInOut* easeUp = [CCEaseBackInOut actionWithAction:scaleUp];
//动作:缩小
CCScaleTo* scaleDown = [CCScaleTo actionWithDuration:CCRANDOM_0_1() * 2 + 1 scale:0.95f];
//速度渐变动作:速度由慢至快,再由快至慢
CCEaseBackInOut* easeDown = [CCEaseBackInOut actionWithAction:scaleDown];
CCSequence* scaleSequence = [CCSequence actions:easeUp, easeDown, nil];
CCRepeatForever* repeatScale = [CCRepeatForever actionWithAction:scaleSequence];
[spider runAction:repeatScale];