Roope's Cocos2d-x Study Tour 003: act together to do--spawn and sequence

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.