views:

40

answers:

1

I am developing application in cocos2d framework 0.99.

I have 100 images for animation, the image is big so it's difficult to load how can I get those image catche once and use in the application.

I am using following code:

CCAnimation *walkingAnimation = 
    [CCAnimation animationWithName:@"Flying Animation" delay:1.0f/10];

for (int i=1;i<26;i++) {
    [walkingAnimation addFrameWithFilename:
         [@"night"stringByAppendingString:
             [NSString stringWithFormat:@"%i.png",i]]];
}

CCAnimate *walk = [CCAnimate actionWithAnimation:walkingAnimation];

Anyone knows please help.

A: 

You should try using texture atlases. I can't remember Cocos atlas class, but it should be something like CCSpriteAtlas

Joshua Weinberg