Particles

This section deals with the use of particles to create cheap graphic effects.

For complex things in GameMaker: Studio you would normally have an object and create instances of that object around the room. However, for graphics effects, this can be expensive as every instance comes with a "cost" in processing due to the variables it contains and the codes it has in the different events. You can reduce this cost by turning to tiles for drawing your graphics needs but those are generally static and cannot easily be changed or moved. However, there is one other option for drawing fast yet versatile graphics effects in your games, and that is to use particles.

What are particles?

Particles are graphic resources that have certain properties which are defined within a particle system. These properties cannot be manipulated directly for individual particles, but are changed through the code that is used to define the individual particle and the system that it belongs to. They are very useful for creating beautiful and flashy effects (or subtle and discreet ones!) like explosions, decals, rain, snow, star fields and debris in a game without the CPU overhead that using instances has.

The basic setup for a particle system follows three steps, with the third step being optional depending on how you wish to create your particle effects within the room:

Limitations

Although particles are an excellent tool for creating effects, they do come with certain restrictions and good practices which need to be followed unless you want your game to grind to halt and eventually crash:

The following sections cover all aspects of coding your own particle systems:

  1. Simple Effects
  2. Particle Systems
  3. Particle Types
  4. Particle Emitters


Back: Reference
© Copyright YoYo Games Ltd. 2018 All Rights Reserved