08.11.2012 Views

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

front of, or between object instances, each particle system has a depth, similar to instances<br />

and tiles.<br />

Particle systems will live on forever after they are created. So even if you change room or<br />

restart the game, the systems and the particles remain. So you better make sure you destroy<br />

them once you no longer need them.<br />

The following basic functions deal <strong>with</strong> particle systems:<br />

part_system_create() Creates a new particle system. It returns the index<br />

of the system. This index must be used in all calls below to set the properties<br />

of the particle system.<br />

part_system_destroy(ind) Destroys the particle system ind. Call this if<br />

you don't need it anymore to save space.<br />

part_system_exists(ind) Returns whether the indicated particle system<br />

exists.<br />

part_system_clear(ind) Clears the particle system ind to its default<br />

settings, removing all particles and emitter and attractors in it.<br />

part_system_draw_order(ind,oldtonew) Sets the order in which the<br />

particle system draws the particles. When oldtonew is true the oldest particles<br />

are drawn first and the newer one lie on top of them (default). Otherwise the<br />

newest particles are drawn first. This can give rather different effects.<br />

part_system_depth(ind,depth) Sets the depth of the particle system.<br />

This can be used to let the particles appear behind, in front of, or in between<br />

instances.<br />

part_system_position(ind,x,y) Sets the position where the particle<br />

system is drawn. This is normally not necessary but if you want to have<br />

particles at a position relative to a moving object, you can set the position e.g.<br />

to that object.<br />

As indicated above, the particle system is automatically updated and drawn. But sometimes<br />

this is not what you want. To facilitate this, you can switch off automatic updating or drawing<br />

and then decide yourself when to update or draw the particle system. For this you can use the<br />

following functions:<br />

part_system_automatic_update(ind,automatic) Indicates whether<br />

the particle system must be updated automatically (1) or not (0). Default is 1.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!