Brendoni123
Member
I started trying to understand particles and I pretty much was able to understand step by step. Although this may be the case, I (of course) had a small problem. In my game, one room would have a snow particle, when I go into the next one, I don't want to have the snow particle, yet it still is streaming the particles. My object is not persistent in this case, so I don't know why it is carrying over still. Here's my code:
For OBJ_particle_system
Create Event:
//Create the Particle System
global.ps = part_system_create();
em = part_emitter_create(global.ps);
part_emitter_region(global.ps, em, 0, room_width, -16, 0, ps_shape_rectangle, ps_distr_linear);
//Initialize the particles
scr_part_blood_init();
scr_part_snow_init();
Step Event:
part_emitter_stream(global.ps, em, global.pt_snow, 5);
Game End Event:
//Destroys the particle system and type
part_type_destroy(global.pt_snow);
part_type_destroy(global.pt_blood);
part_system_destroy(global.ps);
Script for Snow Particles:
//Initialize our global snow particle
global.pt_snow = part_type_create();
var pt = global.pt_snow;
//Set the settings for the snow particle
part_type_shape(pt, pt_shape_pixel);
part_type_size(pt, 1, 2, 0, 0);
part_type_color1(pt, c_white);
part_type_speed(pt, 2, 3, 0, 0);
part_type_direction(pt, 240, 310, 0, 0);
part_type_life(pt, 400, 400);
Like I said, I have most of the basics down tight, its just making sure that these particles don't carry over to another room that I don't wish to have these particles. If anyone knows how I can do this, please let me know. Thanks.
For OBJ_particle_system
Create Event:
//Create the Particle System
global.ps = part_system_create();
em = part_emitter_create(global.ps);
part_emitter_region(global.ps, em, 0, room_width, -16, 0, ps_shape_rectangle, ps_distr_linear);
//Initialize the particles
scr_part_blood_init();
scr_part_snow_init();
Step Event:
part_emitter_stream(global.ps, em, global.pt_snow, 5);
Game End Event:
//Destroys the particle system and type
part_type_destroy(global.pt_snow);
part_type_destroy(global.pt_blood);
part_system_destroy(global.ps);
Script for Snow Particles:
//Initialize our global snow particle
global.pt_snow = part_type_create();
var pt = global.pt_snow;
//Set the settings for the snow particle
part_type_shape(pt, pt_shape_pixel);
part_type_size(pt, 1, 2, 0, 0);
part_type_color1(pt, c_white);
part_type_speed(pt, 2, 3, 0, 0);
part_type_direction(pt, 240, 310, 0, 0);
part_type_life(pt, 400, 400);
Like I said, I have most of the basics down tight, its just making sure that these particles don't carry over to another room that I don't wish to have these particles. If anyone knows how I can do this, please let me know. Thanks.