Here, we stick several effects of particles for future use.
Address: http://blog.csdn.net/qqmcy/article/details/37511259
//// Intervallayer. CPP // testthirdone /// created by du jia on 14-7-7. //// # include "intervallayer. H "# define sid_step1 100 # define sid_step2 101 # define sid_step3 102 # define idc_pause 200 bool intervallayer: Init () {return true;} intervallayer: intervallayer () {_ time0 = _ time1 = _ time2 = _ time3 = _ time4 = 0.0f; Auto S = Director: getinstance ()-> getwinsize (); Auto sun = participant Sun :: create (); Sun-> settexture (Director: getinstance ()-> gettexturecache ()-> addimage ("fire.png"); Sun-> setposition (vec2 (S. width/2-100, S. height/2); Sun-> settotalparticipant (130); Sun-> setlife (5.0f); this-> addchild (Sun); // timers auto fire = participant fire :: create (); fire-> settexture (Director: getinstance ()-> gettexturecache ()-> addimage ("fire.png"); fire-> setposition (vec2 (S. width/2 + 50, S. height/2); fire-> settotaltaskles (130); fire-> setlife (5.0f); this-> addchild (fire); Auto fireworks = FIG: Create (); fireworks-> settexture (Director: getinstance ()-> gettexturecache ()-> addimage ("fire.png"); fireworks-> setposition (vec2 (S. width/2 + 50, S. height/2-200); fireworks-> settotalparticipant (130); fireworks-> setlife (5.0f); this-> addchild (Fireworks); Auto galaxy = participant galaxy :: create (); Galaxy-> settexture (Director: getinstance ()-> gettexturecache ()-> addimage ("fire.png"); Galaxy-> setposition (vec2 (50, s. height/2 + 200); Galaxy-> settotalparticipant (130); Galaxy-> setlife (5.0f); this-> addchild (Galaxy); Auto flower = participant flower :: create (); flower-> settexture (Director: getinstance ()-> gettexturecache ()-> addimage ("fire.png"); flower-> setposition (vec2 (250, s. height/2 + 200); flower-> settotalparticipant (130); flower-> setlife (5.0f); this-> addchild (flower); // meteor auto meteor = MAID:: Create (); meteor-> settexture (Director: getinstance ()-> gettexturecache ()-> addimage ("fire.png"); meteor-> setposition (vec2 (250, 20); meteor-> settotalparticipant (130); meteor-> setlife (5.0f); this-> addchild (meteor); // vortex auto spiral = participant spiral :: create (); spiral-> settexture (Director: getinstance ()-> gettexturecache ()-> addimage ("fire.png"); spiral-> setposition (vec2 (450, 40); spiral-> settotalparticipant (130); spiral-> setlife (5.0f); this-> addchild (spiral); // explosion auto explosion = participant explosion :: create (); explosion-> settexture (Director: getinstance ()-> gettexturecache ()-> addimage ("fire.png ")); explosion-> setposition (vec2 (50,440); explosion-> settotalparticipant (130); explosion-> setlife (5.0f); this-> addchild (explosion ); // smoke auto smoke = MAID: Create (); smoke-> settexture (Director: getinstance ()-> gettexturecache ()-> addimage ("fire.png ")); smoke-> setposition (vec2 (450,640); smoke-> settotalparticipant (130); smoke-> setlife (5.0f); this-> addchild (smoke ); // snow auto snow = MAID: Create (); snow-> settexture (Director: getinstance ()-> gettexturecache ()-> addimage ("fire.png ")); snow-> setposition (vec2 (450,840); snow-> settotalparticipant (130); snow-> setlife (5.0f); this-> addchild (Snow ); // rain auto rain = MAID: Create (); rain-> settexture (Director: getinstance ()-> gettexturecache ()-> addimage ("fire.png ")); rain-> setposition (vec2 (450,940); rain-> settotalparticipant (130); rain-> setlife (5.0f); this-> addchild (rain );}
: