Please upgrade your flash version.

System Architecture

The following is a brief explanation of the different pieces of the Pulse Particle system.

PulseEngine

Class: com.roguedevelopment.pulse.PulseEngine

The PulseEngine is responsible for keeping track of all the active particles and running them through their life sequences. This is the place to find the main timer & associated event handler that actually animates the particles. There is only one of these in an application.

Particle Factories

Interface: com.roguedevelopment.pulse.particle.IParticleFactory
Reference Implementation: com.roguedevelopment.pulse.particle.GenericFactory

A particle factory creates particles when asked to. The newParticle() method is the most important method of these as they create and return the new particle. A particle factory is used by a particle emitter.

Some particles are recycleable (meaning they can be reused once they "die"), the factory is also responsible for keeping this list of recylced particles around and using them when available.

Particle Emitters

Interface: com.roguedevelopment.pulse.emitter.IParticleEmitter
Reference implementation: com.roguedevelopment.pulse.emitter.GenericEmitter
Other Implementations:
com.roguedevelopment.pulse.emitter.MouseEmitter - Just like a GenericEmitter, but follows the mouse around.
com.roguedevelopment.pulse.emitter.MovieClipEmitter - Used in the Flash .mxp extension to allow a user to place an emitter on the timeline.

An emitter creates particles using a factory at a predetermined rate. It can be moved by setting the x or y attributes.

Particles

Class: com.roguedevelopment.pulse.particle.Particle

Right now, particles must descend from the Particle superclass. Eventually, it's planned to turn this into a generic interface so a wider range of particles can be created.

Each particle maintains a list of the active rules for that particle. Each particle usually has a visual representation (they derive from Sprite so they can draw on themselves).

Particle Rules

Interface: com.roguedevelopment.pulse.rule.IPulseRule
Sample Classes: com.roguedevelopment.pulse.rule.*

Each rule defines a simple behavior. For example, there's a rule that allows particles to move, one that causes them to dade out, and another that will kill off particles after a set amount of time. By combining the rules complex particle behavior can be created.

Simple Particle Interface

Class: com.roguedevelopment.pulse.simple.SimpleParticles

This class has several static methods for turning an object representation of a particle configuration and turning it into a particle emitter. Whenever you add rules you should update this class so they can be used through the object syntax, and through the flash extension. To add support for new rules, add the new rule to the rules property and modify the Rule's configure method so it can accept configuration from this class.