2 ooomiao oOOMIAO 于 2013.04.11 15:37 提问

如何在cocos2d中结束进程

代码实现功能是,每1.5添加一个子图片。

[self schedule:@selector(addTraget:) interval:1.5];

-(void)addTraget:(ccTime)dt{
CCSprite *target = [CCSprite spriteWithFile:@"img1.png" rect:CGRectMake(0, 0, 80, 36)];

target.position = ccp(-target.contentSize.width/2, 100);
[self addChild:target];
target.tag = 1;

id actionMove = [CCMoveTo actionWithDuration:actualDuration*2.5 position:ccp(winSize.width + (target.contentSize.width/2), actualY)];
id actionMoveDone = [CCCallFuncN actionWithTarget:self selector:@selector(spriteMoveFinished:)];
id sequece = [CCSequence actions:delayTime1, calFun1, delayTime2, calFun2,actionMove, actionMoveDone, nil];
id repeate = [CCRepeatForever actionWithAction:sequece];

[target runAction:repeate];
}

由于addTarget方法是预定的,应该怎么设置一段时间之后结束这这段进程?

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!