I have a few animated sprites in my cocos2d iPhone game. By animated sprite I mean a CCSprite that has a CCRepeatForever action run on it. The repeat action cycles through the frames of the animation which come from a png spritesheet and associated plist coordinates file.
While I have only a few unique animations I have many animated sprites with the same animation. For example I might have 30 animated soccer players running around the screen all running a CCRepeatForever action. What's an efficient way to pre-load and re-use the animations in this case?
My current approach is to create the repeat actions when the game starts-up. Then when I want to create a new animated sprite I run a copy of the pre-loaded repeat action on the sprite. I question whether this is very efficient since the animations sometime stutter when starting. All feedback is greatly appreciated! I'm open to pretty much any architecture/set-up.
Edit - more info: I'm wondering if "pre-copying" the actions could work? When the game loads I'd fill a queue with copies of the repeat action. Then I'd pop them off as needed. When the size of the queue is below some threshold I'd refill it on a background thread.