Methods
-
addemitter(x, y, maxparticles)
-
Creates a particle emitter at the given location, with a total number of max particles.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description x
Number the x location of the emitter
y
Number the y location of the emitter
maxparticles
Number the total number of particles in the emitter
Code Equivalent:
game.add.emitter(x, y, maxparticles)
-
Blockly.JavaScript['emitters_set_alpha'](block)
-
Parameters:
Name Type Description block
Code Equivalent:
undefined
-
Blockly.JavaScript['emitters_set_speed'](block)
-
Parameters:
Name Type Description block
Code Equivalent:
undefined
-
emitters_make_particles(emitter, keys, frames, quantity, collide, collideWorldBounds)
-
Generates new particles to be used by the emitter.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description emitter
emitter to make new particles for
keys
String the sprite/texture to use for the particles
frames
Number the frames the sprites will use
quantity
Number the number of particles to generate
collide
Boolean whether or not the particles should collide with physics bodies
collideWorldBounds
Boolean whether or not the particles should collide with the world bounds
Code Equivalent:
emitter.makeParticles('tag');
-
emitters_set_alpha(emitter, min, max, rate)
-
Sets the alpha constraints and variations for the particles on the emitter.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description emitter
emitter to change the particles of
min
Number the minimum value the alpha of the particles can reach
max
Number the maximum value the alpha of the particles can reach
rate
Number the rate the particles will change between min and max
Code Equivalent:
emitter.setAlpha(min, max, rate);
-
emitters_set_gravity(emitter, particle_gravity)
-
Sets the gravity each particle has when launched from the emitter.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description emitter
emitter to set the gravity of the particles for
particle_gravity
Number the gravity each particle will have
Code Equivalent:
emitter.gravity = gravity;
-
emitters_set_scale(emitter, minx, maxx, miny, maxy, rate)
-
Sets the scale constraints and variations for the particles on the emitter.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description emitter
emitter to change the particles of
minx
Number the minimum x value the scale the particles can reach
maxx
Number the maximum x value the scale the particles can reach
miny
Number the minimum y value the scale the particles can reach
maxy
Number the maximum y value the scale the particles can reach
rate
Number the rate the particles will change between min and max
Code Equivalent:
emitter.setScale(minx, maxx, miny, maxy, rate);
-
emitters_set_speed(emitter, minx, maxx, miny, maxy)
-
Sets the maximum and minimum speeds of the particles released from the emitter.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description emitter
emitter to set the speed of the particles for
minx
Number the minimum speed for the particles to move in the x direction
maxx
Number the maximum speed for the particles to move in the x direction
miny
Number the minimum speed for the particles to move in the y direction
maxy
Number the maximum speed for the particles to move in the y direction
Code Equivalent:
tMax;
-
emitters_start(emitter, explode, lifespan, frequency, quantity)
-
Tell the emitter to start emitting particles.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description emitter
emitter to start emitting particles from
explode
Boolean whether the particles should burst out at once (true), or at the frequency given (false)
lifespan
Number how long each particle lives once emitted
frequency
Number the interval between the release of each particle
quantity
Number how many particles to emit before turning off
Code Equivalent:
emitter.start(explode, lifespan, frequency, quantity);