The second method of animation implementation is var animation = cc. animation. create (); // create an animation object for (var I = 1; I <15; I ++) {// cyclically load the image var frameName = "res/Images/dance" + (I <10 )? ("0" + I): I) + ". png "; // The image name is 01-14.png. The two digits are" 0 "+ I, and the two digits are I animation. addSpriteFrameWithFile (frameName);} animation. setDelayPerUnit (2.8/14); // sets the animation interval for each frame, in seconds. In this example, 2.8/14 indicates that a total of 14 animations are played at 2.8 s. setRestoreOriginalFrame (true); // sets whether to reset the animation to the original frame var action = cc after it is played. animate. create (animation); // cc. animate is cc. A subclass of the Action groups class to create an animation Action this. sprite. runAction (cc. sequence. create ( Ction, action. reverse (); // executes the animation // cc. some methods of the Animate class clone (); // create a new action instance and execute the same action multiple times. This method is required after the second operation. GetAnimation (); // get the animation object reverse (); // The opposite action setAnimation () to call this method; // set the animation object to play