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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

part_type_create() Creates a new particle type. It returns the index of the<br />

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

particle type. So you will often store it in a global variable.<br />

part_type_destroy(ind) Destroys particle type ind. Call this if you don't<br />

need it anymore to save space.<br />

part_type_exists(ind) Returns whether the indicated particle type exists.<br />

part_type_clear(ind) Clears the particle type ind to its default settings.<br />

The shape of a particle<br />

A particle has a shape. This shape is indicated by a sprite. You can use any sprite you like for<br />

your particles but there are 15 built-in sprites. These are all 64x64 in size and have alpha<br />

values set such that they nicely blend <strong>with</strong> the background. They are indicate by the following<br />

constants:<br />

• pt_shape_pixel<br />

• pt_shape_disk<br />

• pt_shape_square<br />

• pt_shape_line<br />

• pt_shape_star<br />

• pt_shape_circle<br />

• pt_shape_ring<br />

• pt_shape_sphere<br />

• pt_shape_flare<br />

• pt_shape_spark<br />

• pt_shape_explosion<br />

• pt_shape_cloud<br />

• pt_shape_smoke<br />

• pt_shape_snow<br />

You set the shape using the following function:<br />

part_type_shape(ind,shape) Sets the shape of the particle type to any of<br />

the constants above (default is pt_shape_pixel).<br />

You can also use your own sprite for the particle. If the sprite has multiple subimages you can<br />

indicate what should be done <strong>with</strong> them. You can pick a random one, animate the sprite, start

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

Saved successfully!

Ooh no, something went wrong!