A value between minimum speed multipler and 1 is randomly generated and multiplied with each speed value to generate the actual speed for each particle.
Algebraic expression describing the movement of the particle.
Speed of the particles in world units/second. This affects the x value in the path. Unlike normal speed movement, this can have negative values.
Order in which the behavior will be handled. Lower numbers are handled earlier, with an order of 0 getting special treatment before the Emitter's transformation is applied.
The function representing the path the particle should take.
Called to initialize a wave of particles, with a reference to the first particle in the linked list.
Updates a single particle for a given period of time elapsed. Return true
to recycle the particle.
Generated using TypeDoc
A particle that follows a path defined by an algebraic expression, e.g. "sin(x)" or "5x + 3". To use this class, the behavior config must have a "path" string or function.
A string should have "x" in it to represent movement (from the speed settings of the behavior). It may have numbers, parentheses, the four basic operations, and any Math functions or properties (without the preceding "Math."). The overall movement of the particle and the expression value become x and y positions for the particle, respectively. The final position is rotated by the spawn rotation/angle of the particle.
A function merely needs to accept the "x" argument and output the a corresponding "y" value.
Some example paths:
"sin(x/10) * 20"
A sine wave path."cos(x/100) * 30"
Particles curve counterclockwise (for medium speed/low lifetime particles)"pow(x/10, 2) / 2"
Particles curve clockwise (remember, +y is down).(x) => Math.floor(x) * 3
Supplying an existing function should look like thisExample configuration: