A
AdinMilo
Guest
Hey ya'll
I went a bit crazy with particles and have my Rocket Ship streaming smoke when it moves, asteroids with little pixels coming off them as they roll around space, a black hole that sparkles etc etc.
One thing I noticed is that when I play the game for about 1 minute it all of a sudden slows down so drastically, its unplayable. We put two and two together and thought it could be particles. After looking online I saw that quite often people will say you have to "Destroy" or "Clear" them after you die or the game ends.
I was messing around with this code (located in obj_asteroid > step event > code)
if (global.life > 0)
{
global.life -= 1;
global.myTime = 30;
instance_create(1696,1200,obj_player);
part_system_destroy(obj_player.part1_sys);
part_system_destroy(obj_asteroid_l.part2_sys);
part_emitter_destroy(obj_asteroid_l.part2_sys,obj_asteroid_l.part2_emit);
part_system_destroy(obj_asteroid.part2_sys);
part_emitter_destroy(obj_asteroid.part2_sys,obj_asteroid.part2_emit);
part_system_destroy(obj_blackholering.part2_sys);
part_emitter_destroy(obj_blackholering.part2_sys,obj_blackholering.part2_emit);
}
and here is an example of the some particle code I have attached to an object (obj_blackholering > step event > code)
part_system_depth(part2_sys,0);
//colPurple = make_colour_rgb(91, 82, 69);
//Particle
part2 = part_type_create();
part_type_shape(part2,pt_shape_pixel);
part_type_scale(part2,5,5);
part_type_size(part2,1,1,-0.005,0);
part_type_colour1(part2,c_purple);
part_type_alpha2(part2,0.5,-5);
part_type_speed(part2,0.5,0.5,-1,0);
part_type_direction(part2,360,0,0,0);
part_type_gravity(part2,0,90);
part_type_life(part2,room_speed,room_speed-50);
part_type_blend(part2,0);
//Particle Emitter
part2_emit = part_emitter_create(part2_sys);
part_emitter_region(part2_sys,part2_emit,x-120,x+120,y-120,y+120,ps_shape_ellipse,ps_distr_invgaussian);
part_emitter_burst(part2_sys,part2_emit,part2,irandom(-5));
But with no success. I was wondering where I would tell the game to wipe the Particles after the player loses a life or respawns, and where I could put the code so its not just floating around my obj_asteroid.
p.s
Sorry about the mass of code, still a noob to it all.
-A
I went a bit crazy with particles and have my Rocket Ship streaming smoke when it moves, asteroids with little pixels coming off them as they roll around space, a black hole that sparkles etc etc.
One thing I noticed is that when I play the game for about 1 minute it all of a sudden slows down so drastically, its unplayable. We put two and two together and thought it could be particles. After looking online I saw that quite often people will say you have to "Destroy" or "Clear" them after you die or the game ends.
I was messing around with this code (located in obj_asteroid > step event > code)
if (global.life > 0)
{
global.life -= 1;
global.myTime = 30;
instance_create(1696,1200,obj_player);
part_system_destroy(obj_player.part1_sys);
part_system_destroy(obj_asteroid_l.part2_sys);
part_emitter_destroy(obj_asteroid_l.part2_sys,obj_asteroid_l.part2_emit);
part_system_destroy(obj_asteroid.part2_sys);
part_emitter_destroy(obj_asteroid.part2_sys,obj_asteroid.part2_emit);
part_system_destroy(obj_blackholering.part2_sys);
part_emitter_destroy(obj_blackholering.part2_sys,obj_blackholering.part2_emit);
}
and here is an example of the some particle code I have attached to an object (obj_blackholering > step event > code)
//Particle System
part2_sys = part_system_create();part_system_depth(part2_sys,0);
//colPurple = make_colour_rgb(91, 82, 69);
//Particle
part2 = part_type_create();
part_type_shape(part2,pt_shape_pixel);
part_type_scale(part2,5,5);
part_type_size(part2,1,1,-0.005,0);
part_type_colour1(part2,c_purple);
part_type_alpha2(part2,0.5,-5);
part_type_speed(part2,0.5,0.5,-1,0);
part_type_direction(part2,360,0,0,0);
part_type_gravity(part2,0,90);
part_type_life(part2,room_speed,room_speed-50);
part_type_blend(part2,0);
//Particle Emitter
part2_emit = part_emitter_create(part2_sys);
part_emitter_region(part2_sys,part2_emit,x-120,x+120,y-120,y+120,ps_shape_ellipse,ps_distr_invgaussian);
part_emitter_burst(part2_sys,part2_emit,part2,irandom(-5));
But with no success. I was wondering where I would tell the game to wipe the Particles after the player loses a life or respawns, and where I could put the code so its not just floating around my obj_asteroid.
p.s
Sorry about the mass of code, still a noob to it all.
-A