First, Spawn is a simultaneous action, and Sequence is a sequential action ..
Someone asked me why I only called the second one in Spawn? The Code is as follows:
// CCAnimation * animation1 = CCAnimation: createWithSpriteFrames (animFrames, 0.10f );
// CCAnimation * animation2 = CCAnimation: createWithSpriteFrames (animFrames1, 0.10f );
// CCSpawn * spawn = CCSpawn: create (CCFiniteTimeAction *) animation1, (CCFiniteTimeAction *) animation2/* can only play this one */, NULL );
// Sprite-> stopAllActions ();
// Sprite-> runAction (spawn );
Not Spawn cannot call two actions at the same time. The problem is that both actions are sequential frame animations.
The sequence frame animation updates the texture display of the genie according to the set time frequency, and the same Genie cannot display two textures. (The above code is not the first one not called, but overwritten)
What is Spawn used in?
For example, a role moves, one of which is an animation and one MoveTo action. The two actions can be implemented using Spawn.