[Cocos2d-x game engine development notes (9)] Achieve Dota skill Cooling Effect

Source: Internet
Author: User
Tags addchild dota

OriginalArticle, Reprint please indicate the source: http://blog.csdn.net/zhy_cheng/article/details/8278012

The implementation principle is to put two pictures, one bright and the other dark, put the dark picture under the bright picture, and then let the bright picture achieve the animation effect.

The suffocating blade of the phantom assassin allows the enemy unit to slow down and be hurt for 8 seconds.

 

I am very keen on phantom thorns.

Next let's take a lookCodeImplementation:

Ccsprite * S2 = ccsprite: Create ("pa2.png"); // pa2.png is a darker image S2-> setposition (CCP (200,200); addchild (S2, 0 ); ccsprite * s = ccsprite: Create ("pa1.png"); // pa1.png is a bright image ccprogresstimer * PT = ccprogresstite: progresswithsprite (s ); pt-> setposition (CCP (200,200); // implement Pt-> settype (cocos2d: ccprogresstimertype (kccprogresstimertyperadial) in the circle CD )); // appears from the middle to the outside // Pt-> settype (cocos2d: ccprogresstimertype (kccprogresstimertypebar); this-> addchild (PT, 1); ccprogressto * t = ccprogressto:: Action withduration (8,100); Pt-> runaction (ccrepeatforever: actionwithaction (t ));

There are comments in the code, so I won't say much.

Below is:

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.