I just don ' t want to regret it:
没什么好说的=。=,代码注释的很详细。
Size visivlesize=Director:: getinstance() -Getvisiblesize ();/ * Create an elf * /Sprite*Sprite=Sprite:: Create("Sprite.png"); sprite -SetPosition (Point (visivlesize.Width/2, visivlesize.Height/ 2)); AddChild (sprite);/ * Create a Move Action object * /Moveby*Moveby=Moveby:: Create(2.2F, point ( -, -));/ * Create a Bounce Action Object * /Jumpby*Jumpby=Jumpby:: Create(3.0F, point ( -,1), -,5);/ * Create a rotation Action object * /Rotateby*Rotateby=Rotateby:: Create(2.5F the,Ten);/* Use spawn instead of action to connect all the actions (of course, you can do this directly without action, directly with Spawn), "Play together" *// * Why is the last parameter a null reference? (Because the spawn create function is a mutable parameter, the end is represented by a null value) */Action*Actions=Spawn:: Create(Moveby, Jumpby, Rotateby,NULL);/ * Use sequence instead of action to connect all the actions, "one one" in order of Play * ///action* actions = Sequence::create (Moveby, Jumpby, Rotateby, NULL);Sprite -Runaction (actions);return true;
Roope's Cocos2d-x Study Tour 003: act together to do--spawn and sequence