Reputation: 5255
what is the recommended approach to playing animation sequences that include as the end-stone a repeating animation. For example, here are a few scenarios:
CCSequence does not let me do this, as the "idle" animation is wrapped into a CCRepeatForever. If I simply chose to run whatever animation I like above the idling animation I get frame flickering (looks like both animations are played at the same time) — sucks.
All animations are inside CCAnimationCache ... any advice will be highly appreciated.
Upvotes: 0
Views: 724
Reputation: 69047
I don't know if there is a recommended approach. What I would do is running the second animation (the repeating one) with a delay or by chaining it to the first through the animation completion handler.
An easy way to do the chaining is adding at the end of your first animation a CCCallFunc
action, like here, that will call trigger the second animation:
CCActionInterval* action = [CCSequence actions:
[CCProgressFromTo actionWithDuration:duration_ from:100.f to:0.f],
[CCCallFunc actionWithTarget:self selector:@selector(startSecondAction)],
nil ];
Upvotes: 1