part_type_death

Sets a particle type to emit another particle type at the end of its lifetime.

Syntax:

GML Code Example

part_type_death(ind, death_number, death_type);


Argument Description
ind The index of the particle type to change.
death_number The quantity of the new particle to create at the particle death. If a negative value, it will instead create a fraction chance one is created (eg -3 would mean that one is created every 3 or so steps).
death_type The index of the particle type to create.


Returns: N/A


Description

This function can be used to make your particle burst another type of particle at the end of its lifetime.

NOTE: NEVER use the same particle type as this will cause an infinite loop and can crash the game in seconds! Also, be very careful when using this as it can greatly increase the number of particles on-screen at a time and cause your games to slow down noticeably.



Example:

GML Code Example

particle1 = part_type_create();
 part_type_shape(particle1, pt_shape_flare);
 part_type_size(particle1, 0.20, 0.30, 0.50, 0);
 part_type_scale(particle1, 0.10, 0.20);
 part_type_colour3(particle1, 33023, 8454143, 33023);
 part_type_alpha3(particle1, 0.30, 0.50, 0);
 part_type_speed(particle1, 0.40, 1, 0, 0);
 part_type_direction(particle1, 0, 359, 0, 20);
 part_type_gravity(particle1, 0.20, 90);
 part_type_orientation(particle1, 90, 90, 0, 0, 1);
 part_type_blend(particle1, 1);
 part_type_life(particle1, 1, 40);
 particle2 = part_type_create();
 part_type_shape(particle2, pt_shape_smoke);
 part_type_size(particle2, 1, 1, 0, 0);
 part_type_scale(particle2, 0.50, 0.50);
 part_type_colour1(particle2, 12632256);
 part_type_alpha3(particle2, 0.10, 0.40, 0);
 part_type_speed(particle2, 0.50, 0.50, 0, 0);
 part_type_direction(particle2, 0, 359, 0, 0);
 part_type_gravity(particle2, 0.20, 90);
 part_type_orientation(particle2, 0, 359, 0, 1, 1);
 part_type_blend(particle2, 0);
 part_type_life(particle2, 60, 60);
 part_type_death(particle1, 1, particle2);
 

The above code creates and defines two particles and sets the particle indexed in the variable "particle1" to create 1 particle of "particle2" at the end of its lifetime.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here