SINGLE POST

Introducing Particle2D

Particle2D logo

Particle2D is a ActionScript 3.0 based particle simulator. I started the development because i need an easy-to-implement and animateable particle system. During the development process for this specific project i decided to give it a try and put some time into writing a basic particle simulator framework. There are already some features included, like PostEffects and GravitySimulation or different types of emitters(OmniEmitter, DirectionalEmitter) but there is a lot of work to do.

Have a look at the Demo here.

For the first release i want to have much more emitter types. I think surface or bitmap-emitters would be great. Also the particle-types should be extended (only shapes available until now).

So, now give us some code.
[as]
myEmitter = new OmniEmitter(this.stage.stageWidth / 2, this.stage.stageHeight / 2);
myEmitter.particlesPerSecond = 1000;
[/as]

This two lines initializes a emitter with default values, if you want to change emitter, particleField or particle parameters you have to initialize several other objects. Have a look on how the post effects are applied.
[as]
var postEffects:ParticlePostEffect = new ParticlePostEffect();
postEffects.addPreset(ParticlePostEffect.BLUR);
postEffects.addPreset(ParticlePostEffect.OUTER_GLOW);
myEmitter.particleField.postProcessing = true;
myEmitter.particleField.postEffects = postEffects;
[/as]

As you can see, the postEffects are applied to the particleField. I have implemented some presets for testing, but you can use every Filter that extends the BitmapFilter class.

Particle2D is designed for being a particle simulator which is animateable and reusable. For this reason there are some limitations you should know. Particle2D is not designed for creating a big amount of particles in a short time. The reason is, that the timer which triggers the particle generating process, depends on the current frame rate. The timer event is f.e. at 33 fps only called 330 times or less in a second. That means that in most cases this will be the maximum number.

Finally, here is a quick and dirty developer preview from Particle2D for download and testing.

I would recommend you to NOT use this in a real project.


Comments are closed.