I have a cut scene animation that plays after a level completes. It consists of 100 png files (total size on disk is about 3.1 mb I believe).
Whenever I try to load it on the device, the iPhone runs out of memory and crashes. If I select a number of frames less that 60, it works fine, but once it gets higher than that it will crash all the time.
Is this standard? Or is there something I can do to use up less memory. If there is no way around it, will decreasing the resolution of the images fix this? (Sounds like a stupid question, but I just want to make sure)...
My code for creating the animation is as follows:
'Sprite * holder = [[Sprite alloc] initWithFile:@"scenebg.jpg"];
holder.transformAnchor = ccp(240,320);
[holder setPosition:ccp(240,320)];
[self addChild:holder z:2 tag:99];
Animation * next = [[Animation alloc] initWithName:@"next" delay:0.06];
for(int i = 10; i <= 110; i++){
[next addFrameWithFilename:[NSString stringWithFormat:@"aurora%04d.png", i]];
}
id animate = [Animate actionWithAnimation:next];
[holder runAction: [Sequence actions: animate, [CallFunc actionWithTarget:self selector:@selector(finish)], nil]];
'