Я пробегаю около 10 различных изображений футбольного мяча, чтобы он выглядел так, как будто он вращается, и я делаю это с помощью CCAnimation. Вот так:
// load the football's animation frames as textures and create a sprite frame
frames = [[NSMutableArray alloc]initWithCapacity:3];
for (int i = 0; i < 10; i++)
{
NSString* file = [NSString stringWithFormat:@"Football%i.png", i];
CCTexture2D* texture = [[CCTextureCache sharedTextureCache] addImage:file];
CGSize texSize = texture.contentSize;
CGRect texRect = CGRectMake(0, 0, texSize.width, texSize.height);
CCSpriteFrame* frame = [CCSpriteFrame frameWithTexture:texture rect:texRect];
[frames addObject:frame];
}
CCAnimation* anim = [CCAnimation animationWithFrames:frames delay:0.03f];
// run the animation by using the CCAnimate action
CCAnimate* animate = [CCAnimate actionWithAnimation:anim];
CCRepeatForever* repeat = [CCRepeatForever actionWithAction:animate];
[self runAction:repeat];
Итак, мой вопрос: когда я сталкиваюсь с другим объектом, есть ли способ, чтобы футбол перестал вращаться?