Different kinds of Emitters.

Mercury Particle Engine comes with several different emitters out of the box. The default emitter (simply called Emitter) releases the particles in a single point. Sometimes we want more than a single point, we want to release the particles in different shapes, such as circles and rectangles. Here is a list of out-of-the-box emitters:

LineEmitter
Distributes all particles randomly on a single line. You can control 4 properties on the line emitter: Length, Angle, Rectillinear and Frame. Length and Angle should be self-explanatory.

The Rectillinear property controls if the emitted particles should decent in a linear manner. The Frame property is used to control if the emitter should emit particles both ways on the Y-axis.

This emitter is great to create something like snow. You set the length of the emitter, to be the length of the screen and that it should be horizontal. All particles (snowflakes) are then released in a line on top of the screen. We would need something like gravity too, to make the particles decent. More on that later in the modifiers chapter.

CircleEmitter
This emitter releases particles randomly distributed in a circle. It has two properties you can change to control the behavior of the emitter: Ring and Radiate.

Ring tells the circle emitter to only create particles on the edge of the circle. You can set this to false to create a filled circle.

Radiate makes sure that the particles radiate away from the center of the circle.
The circle emitter is good for explosions and the like. Depending on the kind of explosion, you just enable or disable Ring and Radiate. The different release patterns can be seen here:

CircleEmitterOptions.png

Cone Emitter
The ConeEmitter sprays the particles out in the specified direction with the specified angle. The emitted particles will take the shape of a spray/cone.

RectEmitter
Rectangle emitter releases the particles in the shape of a rectangle. You control the width and height of the rectangle, but just as the CircleEmitter, you also have the possibility of making the particles spawn only on the edge of the rectangle. You enable this behavior by enabling Frame on the RectEmitter.

Imagine a checkbox inside your game. You could make a nice glow or pulsating effect around this checkbox by using the RectEmitter. To make it pulsate, you will also have to use modifiers, more on this later.

Last edited Aug 24, 2009 at 4:28 PM by JimJams, version 2