Hey guys, I’ve decided to post some of my particle codes for Game Maker Pro. Each one I made myself, and tested to make sure it works. Some are symbols (like for different teams) and other are just designs. I will upload each one soon to a new page, but for now I’m going to show you all how to make one.

—————————————————–

//do not forget the ‘begin’ and ‘end’ blocks

{
// the following 2 lines are used but once, put them in the ‘Create’ event of the object using the particles
global.ps = part_system_create();
global.pt1 = part_type_create();

// put these lines in either your step event (to change when they come out, use ‘if’ statements)

//change ‘pt_shape_line’ to whatever shape you need (e.g – pt_shape_sphere, pt_shape_cloud, etc.)
part_type_shape(global.pt1,pt_shape_line);

//this creates the size; do not change ‘pt1′ but instead change the three middle numbers (1.8,1.9,0)
//’1.8’ indicates the minimum size, ‘1.9’ indicates the maximum, and ‘0’ indicates the increase in size
part_type_size(global.pt1,1.8,1.9,0,0);
//there are three colors available–the start color, middle color, and end color
//change the three numbers to whatever color you want
part_type_color3(global.pt1,64,16777215,16777215);

//this is similar to color3, but instead has alpha channels,
//which causes the particle to become transparent
part_type_alpha3(global.pt1,0.3,0.3,0.3);

//similar to the size, minimum size, max size, and speed increase
part_type_speed(global.pt1,0.01,0.02,0,0);

//this decides how low the particle is ‘alive’
//it indicates minimum and maximum lengths
part_type_life(global.pt1,30,30);

//this tells the particle which way it should go
//minimum, maximum, and increase
//the increase here can make it rotate
part_type_direction(global.pt1,0,0,4,0);

//you can change ‘direction,direction’ to whatever you want
//but as is it makes the particle face whatever way it is moving
part_type_orientation(global.pt1,direction,direction,0,0,1);

//gravity is pretty much speed, but starts out slow and
//continues picking up speed for infinite
//first is gravity strength (0-2 for values), then is direction (0-359)
part_type_gravity(global.pt1,0,0);

//this gives the particle its size, and the second number gives the increase
part_type_scale(global.pt1,1,1);

//I suggest you don’t use this, but if you do it makes it so that
//the particle blends with its background, but it messes up the color
part_type_blend(global.pt1,0);

 
//this just creates the particle emitter
global.em = part_emitter_create(global.ps);

// put these within the step event as well, and change mouse_x and mouse_y to whatever you need
//also, change ‘ps_shape_rectangle’ and ‘ps_distr_linear’ to the shape you want
part_emitter_region(global.ps,global.em,mouse_x,mouse_x,mouse_y,mouse_y,ps_shape_rectangle,ps_distr_linear);
part_emitter_burst(global.ps,global.em,global.pt1,30);

//don’t forget the end sign!
}

—————————————————–

Hope that helps you!

-Nathan Wood

P.S. Check out the new ‘Artwork’ page, which has three new drawings!

Advertisements

About turboRamble

I am a seventeen-year-old who enjoys programming games and applications, as well as reading and writing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s