回调函数实例:
-(void)runtelephoneing{
[self runAction:[CCRepeatForever actionWithAction:[[GameLogic ShareGameLogic] Get_animate:17]]];
}
-(void)runpicking{
[self runAction:[CCSequence actions:[[GameLogic ShareGameLogic] Get_animate:16],[CCCallFunc actionWithTarget:self selector:@selector(runtelephoneing)],nil]];
或者
-(void)actionyun{
if (_delegate && [_delegate respondsToSelector:@selector(runpunishing:)]) {
[_delegate runpunishing:_type];
}
((CCSprite*)[self getChildByTag:TAG_YUN]).visible = YES;
id action = [[GameLogic ShareGameLogic] Get_animate:TAG_YUN];
[[self getChildByTag:TAG_YUN] runAction:action];
}
-(void)actionnode{
id actionfall = [CCMoveTo actionWithDuration:0.5f position:_pointend];
id actioncallyun = [CCCallFunc actionWithTarget:self selector:@selector(actionyun)];
id actionup = [CCMoveTo actionWithDuration:0.5f position:_pointbegan];
id actioncall = [CCCallFunc actionWithTarget:self selector:@selector(delete)];
id actionfright=[CCCallFunc actionWithTarget:self selector:@selector(actionfrighten)];
id actionseq = [CCSequence actions:actionfright,actionfall,actioncallyun,actionup,actioncall, nil];
[[self getChildByTag:TAG_FALL] runAction:actionseq];
}
结束帧并且画面停留的:
CCSprite *zj=(CCSprite*)[self getChildByTag:_TAG_ZJ];
[zj stopAllActions];
[zj setDisplayFrame:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:@"zj_kan_00.png"]];