Hi all-- looking for insight on this...
I'm getting a crash when I try to embed RepeatForever in an action. Using RepeatForever as follows works fine:
`id currentMovementAnimation = [RepeatForever actionWithAction: [Sequence actions:actionOneWay,
[DelayTime actionWithDuration:ani->delay],
actionScale,
[actionOneWay reverse],
[DelayTime actionWithDuration:ani->delay],
[actionScale reverse],
nil]];
[self runAction:currentMovementAnimation]; // Run the movement animation`
However, I want to make an intro animation followed by the RepeatForever. For this, i tried (and failed) with:
`id mainAnimation = [RepeatForever actionWithAction: [Sequence actions:actionOneWay,
[DelayTime actionWithDuration:ani->delay],
actionScale,
[actionOneWay reverse],
[DelayTime actionWithDuration:ani->delay],
[actionScale reverse],
nil]];
id actionWalk = [MoveBy actionWithDuration:[self getAnimationDuration:ani] position:ccp(intro->to.x - intro->from.x, intro->to.y - intro->from.y)];
id actionJump = [MoveBy actionWithDuration:[self getAnimationDuration:ani] position:ccp(ani->from.x - intro->to.x, ani->from.y - intro->to.y)];
id currentMovementAnimation = [Sequence actions:actionWalk,
[DelayTime actionWithDuration:ani->delay],
actionJump,
mainAnimation,
nil];
[self runAction:currentMovementAnimation]; // Run the movement animation`
I can understand logically that if you put RepeatForever in a sequence that the rest of the sequence will not execute. However, it seems we should have the ability to use this as the last step in a compound animation. I would even argue that it should be allowed anywhere in the animation, with the understanding that none of the subsequent actions will execute. Certainly, it shouldn't crash?
Can anyone chime in on this?
Thanks,
Scott