part_type_life

Sets a particle type's lifespan in steps.

Syntax:

part_type_life(ind, life_min, life_max);


Argument Description
ind The index of the particle type to change.
life_min The minimum lifespan of the particles.
life_max The maximum lifespan of the particles.


Returns: N/A


Description

This is the function that governs how long each individual particle of the indicated type remains on the screen. As with other particle functions, you provide a minimum and a maximum value (in steps)and each particle lifespan will be a random number of steps from within the specified range. To have all particles with the same lifetime, set the two values to be the same.


Example:

part_type_life(part_Flare, room_speed, room_speed * 2);

The above code will set all particles created of the particle type indexed in the variable "part_Flare" to have a lifetime of between 1 and 2 seconds, based on the current room-speed.


Back: Particle Types
Next: part_type_step
© Copyright YoYo Games Ltd. 2018 All Rights Reserved