Simple Effects
The easiest way of creating particles is to use the effects mechanism. Effects are created using the particle system but you do not have to worry about all the details. You simply specify the type of effect, the position where it must be created, its size, and its color. That is all.There are a number of different kinds of effects:
- ef_explosion
- ef_ring
- ef_ellipse
- ef_firework
- ef_smoke
- ef_smokeup
- ef_star
- ef_spark
- ef_flare
- ef_cloud
- ef_rain
- ef_snow
Some you want to create just once (like the explosion) and some you want to create in every step (like the smoke or the rain). Note that rain and snow are always created at the top of the room so the position is irrelevant in this case.
Even though this might sound limited, they can actually be used to create great effects. For example by creating a smal puff of red smoke below a moving spaceship in each step, a tail of fire is created. The following two functions exist to create the effects:
effect_create_below(kind,x,y,size,color) Creates an effect of the given kind (see above) at the indicated position. size give the size as follows: 0 = small, 1 = medium, 2 = large. color indicates the color to be used. The effect is created below the instances, that is, at a depth of 100000.
effect_create_above(kind,x,y,size,color) Similar to the previous function but this time the effect is created on top of the instances, that is, at a depth of -100000.
If you want to remove all effects, call the following function:
effect_clear() Clears all effects.