part_particles_create_colour

This function is ideal for those effects that do not require any of the functionality offered by particle emitters (for example, to create smoke from a missile, or a simple explosion effect) as it permits you to quickly and easily create particles at any position in the game room. You can also colour the particles "on the fly" as they are created with this function, and this colour will over-ride the predefined colour of the particle, but it does not blend this colour over the particles lifetime. Note that you must have created the particle system and the particle type previously for this function to be used.

 

Syntax:

part_particles_create_colour(ind, x, y, parttype, colour, number);

ArgumentTypeDescription
indParticle System InstanceThe index of the particle system.
xRealThe x coordinate of where to create the particles.
yRealThe y coordinate of where to create the particles.
parttypeParticle Type IDThe index (type) of the particles to be created.
colourColourThe colour blending for the particles.
numberRealThe number of particles to create.

 

Returns:

N/A

 

Example:

if (speed > 1)
{
    var _c = choose(c_aqua, c_lime, c_fuchsia, c_orange);
    part_particles_create_colour(sname, x, y, p_Smoke, _c, 1);
}

The above code will generate a single particle every step that the instance with the code has a speed greater than one. These particles will be of a random colour.