Hi All,
I have near about 255 image frames for background animation, 99 frames of enemy sprite and 125 frames of player sprite. All animations are running simultaneously on the screen. That is background animation is running and 4-5 enemies are on the screen are present at a time, also player is there at the same time.
Take a look at the code below,
CCAnimation *_enemyAnimation = [CCAnimation animationWithName:@"Enemy" delay:0.1f];
for (int i = 1; i<99; i++) {
[_enemyAnimation addFrameWithFilename:[NSString stringWithFormat:@"enemy %02d.jpg",i]];
}
id action1 = [CCAnimate actionWithAnimation: _enemyAnimation];
[_enemySprite runAction:[CCRepeatForever actionWithAction: action1]];
[self schedule:@selector(BackToGameLogic:) interval:5.0];
This makes my game too slower and consumes memory about 65MB in the allocations.
How should I manage my animations so there will be improvement in speed and memory consumption will be reduced?.
Please suggest me the way.
Thanks.