Например, это может привести к сокращению спрайта до его исчезновения, а затем удалить его из родительского элемента:
-(void)selectSpriteForTouch:(CGPoint)touchLocation
...
if (CGRectContainsPoint(sprite.boundingBox, touchLocation))
{
[sprite runAction:[CCSequence actions:
[CCScaleTo actionWithDuration:0.4 scale:0],
[CCCallFuncO actionWithTarget:self selector:@selector(removeSprite:) object:sprite],
nil]];
...//play audio etc
}
....
}
-(void) removeSprite:(CCSprite*) s
{
[s.parent removeChild:s cleanup:YES];
}
Для других действий попробуйте CCMoveTo
или CCJumpTo
или CCRotateBy
.Вы можете выполнить несколько действий одновременно, поэтому над предоставленной мною строкой runAction:
попробуйте другой [sprite runAction:[CCRotateBy actionWithDuration:0.4 angle:360]]