我正在设计一个测验。想要动画错误的答案精灵2-3秒。然后它应该自动消失。我怎么能这样做?
答案 0 :(得分:3)
CCFadeOut *fade = [CCFadeOut actionWithDuration:3]; //this will make it fade
CCCallFuncN *remove = [CCCallFuncN actionWithTarget:self selector:@selector(removeSprite:)];
CCSequence *seq = [CCSequence actions: fade, remove, nil];
[mySprite runAction:seq];
这是我们上面分配的CCCallFuncN对象调用的方法。
-(void) removeSprite:(id)sender
{
[self removeChild:sender cleanup:YES];
}
希望这有帮助。欢呼!