How to repeat animation only once?
CCSpriteFrameCache * cache = [CCSpriteFrameCache sharedSpriteFrameCache];
[cache addSpriteFramesWithFile:@"texture2.plist"];
CCAnimation * animation = [[CCAnimation alloc] initWithName:@"idle" delay:1/15.0];
for ( int i=1; i < 16; ++i )
{
// frame name format: blob_idle_01.png .. blob_idle_24.png
NSString * fname = [NSString stringWithFormat:@"anim_%01i.png", i];
[animation addFrame:[cache spriteFrameByName: fname]];
}
CCSprite * blob = [CCSprite spriteWithFile:@"texture2.png"];
// deprecated since 0.9: CCSprite * blob = [cache createSpriteWithFrameName:@"blob_idle_01.png"];
//HERE IS THE PROBLEM, IT REPEATS FOREVER BUT I NEED ONLY ONE TIME
id action = [CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:animation]];
[blob runAction:action];
// position our blob
// add blob to scene ( self should be a visible CCLayer or CCScene )
[self addChild:blob];