Cocos2d copied actions not responding?

Posted by Stephen on Game Development See other posts from Game Development or by Stephen
Published on 2012-06-12T17:56:16Z Indexed on 2012/06/12 22:49 UTC
Read the original article Hit count: 324

Filed under:
|

I am running an animation on 2 sprites like so:

-(void) startFootballAnimation {

CCAnimation* footballAnim = [CCAnimation animationWithFrame:@"Football" frameCount:60 delay:0.005f];
spiral = [CCAnimate actionWithAnimation:footballAnim];
CCRepeatForever* repeat = [CCRepeatForever actionWithAction:spiral];
[self runAction:repeat];
[secondFootball runAction:[[repeat copy] autorelease]];

}

The problem I am having is I call this method:

- (void) slowAnimation {

[spiral setDuration:[spiral duration] + 0.01];

}

and it only slows down the first sprites animation and not the second one. Do I need to do something different with copied actions to get them to react to the slowing of the animation?

© Game Development or respective owner

Related posts about cocos2d-iphone

Related posts about cocos2d