Carloskhard
Member
First of all: I've already read multiple threads about this in this forum but none of them work so I need help.
I created a particle system inside my main object like this:
But then I destroy event of that object I do this:
If I just use:
doesn`t work and particles keep being generated.
And if I add the line "part_type_destroy(part_chispas)" the game crashes automatically when the line executate...
What is wrong? Thanks
I created a particle system inside my main object like this:
//Particle System
part_sys_chispas = part_system_create();
part_system_depth(part_sys_chispas,-11);
//Particle
part_chispas = part_type_create();
//part_type_sprite(partPower,spr_humo,false,false,false);
part_type_shape(part_chispas,pt_shape_disk);
part_type_scale(part_chispas,0.5,0.5);
part_type_size(part_chispas,0.5,1.2,-.07,0);
part_type_alpha2(part_chispas,1,.5);
part_type_colour2(part_chispas,c_yellow,c_red);
part_type_life(part_chispas,room_speed/1.8,room_speed/2);
part_type_blend(part_chispas,false);
//Particle Emitter
part_emit_chispas = part_emitter_create(part_sys_chispas);
*chispas means sparkle in spanish..yeo I write half and half spanish english in my code jaja
part_sys_chispas = part_system_create();
part_system_depth(part_sys_chispas,-11);
//Particle
part_chispas = part_type_create();
//part_type_sprite(partPower,spr_humo,false,false,false);
part_type_shape(part_chispas,pt_shape_disk);
part_type_scale(part_chispas,0.5,0.5);
part_type_size(part_chispas,0.5,1.2,-.07,0);
part_type_alpha2(part_chispas,1,.5);
part_type_colour2(part_chispas,c_yellow,c_red);
part_type_life(part_chispas,room_speed/1.8,room_speed/2);
part_type_blend(part_chispas,false);
//Particle Emitter
part_emit_chispas = part_emitter_create(part_sys_chispas);
*chispas means sparkle in spanish..yeo I write half and half spanish english in my code jaja
part_emitter_region(part_sys_chispas,part_emit_chispas,x-70,x+70,y-70,y+70,ps_shape_ellipse,ps_distr_gaussian);
if (hp < 4) particulas = 3;
else if (hp < 7) particulas = 2;
else if (hp < 10) particulas = 1;
else particulas = 0;
part_emitter_stream(part_sys_chispas,part_emit_chispas,part_chispas,particulas);
*particulas means partciles and in this code I check for the hp of the object to create more or less particles
if (hp < 4) particulas = 3;
else if (hp < 7) particulas = 2;
else if (hp < 10) particulas = 1;
else particulas = 0;
part_emitter_stream(part_sys_chispas,part_emit_chispas,part_chispas,particulas);
*particulas means partciles and in this code I check for the hp of the object to create more or less particles
But then I destroy event of that object I do this:
Code:
part_particles_clear(part_emit_chispas)
part_type_destroy(part_chispas)
part_emitter_clear(part_sys_chispas,part_emit_chispas)
Code:
part_particles_clear(part_emit_chispas)
part_emitter_clear(part_sys_chispas,part_emit_chispas)
And if I add the line "part_type_destroy(part_chispas)" the game crashes automatically when the line executate...
What is wrong? Thanks
Last edited: