Sync Tutorial - Adding Particle Effects
Add Tenticle Explosion 1 cell to your project. Double click the image, make it a cell with a X count of 2 and a Y count of 7, and then click save. Then click the Create a new Animation button.
 
Add the frames of the animation in the order shown to the left.
I appologize for the order and quality of this animation but since it is here we might as well make the best of it.
Change the framerate to 20 and uncheck Cycle Animation as well.
Go to the Edit Tab and drag into the scene a new particle effect.
Under UntitledEmitter go to the Animation tab and select the Explosion Animation. The Scroll down and Select Single Particle. Save the effect as Explosion.
Add this code to the EnemyA.cs function EnemyClassA::Explode(%this).
%explosion = new t2dParticleEffect()
{
scenegraph = %
this.scenegraph;
};
%explosion.loadEffect(
"~/data/particles/explosion.eff");
%explosion.setEffectLifeMode(
"KILL", 1);
%explosion.setPosition(%
this.getPosition());
%explosion.playEffect();
Now when the enemies die, and when you die, this particle effect plays.
Next Page
Previous Page