September 2014
Beginner
266 pages
5h 38m
English
Similar to how we created the explosion effect, we will create the flame particle effect. However, as we require the player's position at all times, we will create a global CCParticleSystemQuad instance named flameParticle in the HelloWorldScene.h file.
Import the jetBoost.plist and jetBoost.png files from the resources folder for the chapter and place them in the resources folder of the game.
Next, right under where we added the hudLayer in the init function in HelloWorldScene.cpp file, add the following lines of the code:
flameParticle = CCParticleSystemQuad::create("jetBoost.plist"); flameParticle->setPosition(ccpAdd(hero->getPosition(), ccp(-hero->getContentSize().width * 0.25, 0))); this->addChild(flameParticle); ...Read now
Unlock full access