Changers

Game Maker 8

Changers

Changers change certain particles when they appear in their region. A particle system can have an arbitrary number of changers. A changer has the following properties:
  • xmin, xmax, ymin, ymax indicates the extent of the region in which the particles are changed.
  • shape indicates the shape of the region. It can have the following values:
    • ps_shape_rectangle
    • ps_shape_ellipse
    • ps_shape_diamond
  • parttype1 indicates the particle type that is changed.
  • parttype2 indicates the particle type into which it is changed.
  • kind indicates the kind of changer. It can have the following values:
    • ps_change_motion only changes the motion parameters of the particle, not the color and shape or lifetime settings.
    • ps_change_shape only changes the shape parameters like size and color and shape.
    • ps_change_all changes all parameters, this basically means that the particle is destroyed and a new one of the new type is created.

The following functions are available to set the properties of the changer. Note that each of them gets the index of the particle system to which it belongs as a first argument.

part_changer_create(ps) Creates a new changer in the given particle system. It returns the index of the changer. This index must be used in all calls below to set the properties of the changer.
part_changer_destroy(ps,ind) Destroys changer ind in the particle system. Call this if you don't need it anymore to save space.
part_changer_destroy_all(ps) Destroys all changers in the particle system that have been created.
part_changer_exists(ps,ind) Returns whether the indicated changer exists in the particle system.
part_changer_clear(ps,ind) Clears the changer ind to its default settings.
part_changer_region(ps,ind,xmin,xmax,ymin,ymax,shape) Sets the region for the changer.
part_changer_types(ps,ind,parttype1,parttype2) Sets which particle type the changer must change into what other type.
part_changer_kind(ps,ind,kind) Sets the kind for the changer.