MaTTP
MaTTP

Reputation: 953

Cocos2d for iPhone: i have a delay with with animation (fps collapses)

I've this problem: in my game, when I tap a sprite, an animation in called. This animation is stored inside a singleton class (called Animation) that is inizialized in the didFinischLaunching method. When I need for an action i use this code:

[self runAction:[[Animation sharedAnimation] animationName]];

On the device when I tap the sprite for the first time, occurs the following issues (one and only at the first tap):

  1. There is a delay from the moment when I tap the sprite and the moment that the animation really starts;
  2. In this interval (delay) the frame count collapses to 10fps (in some case even to 6fps)

This issues there aren't when I tap the same sprite for a second, third, etc times.

Ideas ??

Thanks very much!

Upvotes: 1

Views: 375

Answers (1)

erik
erik

Reputation: 448

Do you alloc the spriteframes in your animation init method? If so, that's why.

Good luck!

Upvotes: 1

Related Questions