开发者

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

开发者 https://www.devze.com 2023-02-05 07:12 出处:网络
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 didFinischLa

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!


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

Good luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消