CCSize S = CCDirector: sharedDirector ()-> getWinSize (); // The texture image CCTexture2D * texture = CCTextureCache: sharedTextureCache () required for loading an animation () -> addImage ("Blowfish0.png"); // obtain the CCSpriteFrame * frame0 = CCSpriteFrame: createWithTexture (texture, CCRectMake (160*0,122*0,160,120) of each frame )); CCSpriteFrame * frame1 = CCSpriteFrame: createWithTexture (texture, CCRectMake (160*0,122*1,160,120); CCSpriteFrame * frame2 = CCSpriteFrame: createWithTexture (texture, CCRectMake (160*1,122*0,160,120); CCSpriteFrame * frame3 = CCSpriteFrame: createWithTexture (texture, CCRectMake (160*1,122*1,160,120); CCSpriteFrame * frame4 = CCSpriteFrame :: createWithTexture (texture, CCRectMake (160*2,122*0,160,120); CCSpriteFrame * frame5 = CCSpriteFrame: createWithTexture (texture, CCRectMake (160*2,122*1,160,120 )); CCSpriteFrame * frame6 = CCSpriteFrame: createWithTexture (texture, CCRectMake (160*0,122*2,160,120); CCSpriteFrame * frame7 = CCSpriteFrame: createWithTexture (texture, CCRectMake (160*0,122*3,160,120); CCSpriteFrame * frame8 = CCSpriteFrame: createWithTexture (texture, CCRectMake (160*1,122*2,160,120); CCSpriteFrame * frame9 = CCSpriteFrame :: createWithTexture (texture, CCRectMake (160*1,122*3,160,120); CCSprite * sprite03 = CCSprite: createWithSpriteFrame (frame0); sprite03-> setPosition (ccp (S. width/2 + 180, S. height/2-70 + 100 * I); sprite03-> setScale (0.5 + 0.2 * I); addChild (sprite03, + 10 * I ); CCArray * animFrames = CCArray: createWithCapacity (10); animFrames-> addObject (frame0); animFrames-> addObject (frame1); animFrames-> addObject (frame2 ); animFrames-> frameworks (frame3); animFrames-> addObject (frame4); animFrames-> addObject (frame5); animFrames-> frameworks (frame6); animFrames-> addObject (frame7 ); animFrames-> addObject (frame8); animFrames-> addObject (frame9); // defines the interval between each frame and the animation CCAnimation * animation = CCAnimation: createWithSpriteFrames (animFrames, 0.5); // create an animation Action CCAnimate * animate = CCAnimate: create (animation); CCActionInterval * seq = (CCActionInterval *) (CCSequence: create (animate, CCFlipX :: create (false), animate-> copy ()-> autorelease (), CCFlipX: create (false), NULL); sprite03-> runAction (CCRepeatForever :: create (seq ));}}