GothicLogic
Member
I'm not experienced with particles really at all, I've looked all over but I cant fix my problem.
This is for a 2D Platformer.
I followed this tutorial online to help get myself familiarized with particles - https://gamedevelopment.tutsplus.co...e-gamemaker-studio-particle-system--cms-22782
i replicated the first one, the green fire effect that just sits there, here's my code -
This is just a standalone object, I wanted to go this route because of what I am using them for with ease (and because thats just how i know how to use them) such as like this
https://imgur.com/a/6sy91OQ
----------------------------------------------------
My problem is that I cannot clear the particles when I quit the game. So if I were to force the game to move to the title screen from the pause menu, the particles will stay there thus causing a memory leak.
I can however clear the particles when I die, or when I move to the next room.
Here's my code for how I'm moving to the title screen
Anyone mind giving me some more knowledge on how this works? I heard about global particles, I tried my hand at that but I couldn't get it to work, is that something I'd need to go with? I'm only using it for this specific world so, does it matter?
Any help is greatly appreciated, thank you.
This is for a 2D Platformer.
I followed this tutorial online to help get myself familiarized with particles - https://gamedevelopment.tutsplus.co...e-gamemaker-studio-particle-system--cms-22782
i replicated the first one, the green fire effect that just sits there, here's my code -
Code:
///Creation
FirstParticleSystem = part_system_create();
first_particle = part_type_create();
part_system_depth(FirstParticleSystem,1);
part_type_shape(first_particle,pt_shape_square);
part_type_scale(first_particle,1,1);
part_type_size(first_particle,0.050,0.055,-.001,0);
part_type_color2(first_particle,8454143,65280);
part_type_alpha2(first_particle,1,0.75);
part_type_speed(first_particle,0.1,0.5,0,0);
part_type_direction(first_particle,0,359,0,0);
part_type_gravity(first_particle,0.02,90);
part_type_orientation(first_particle,0,359,10,0,true);
part_type_life(first_particle,100,150);
part_type_blend(first_particle,true);
first_emitter = part_emitter_create(FirstParticleSystem);
part_emitter_region(FirstParticleSystem, first_emitter, x-20, x+20, y-20, y+20, ps_shape_ellipse, ps_distr_gaussian);
part_emitter_stream(FirstParticleSystem,first_emitter,first_particle,2);
Code:
///Room End Event
part_type_destroy(first_particle);
part_emitter_destroy(first_emitter, first_particle);
part_system_destroy(FirstParticleSystem);
This is just a standalone object, I wanted to go this route because of what I am using them for with ease (and because thats just how i know how to use them) such as like this
https://imgur.com/a/6sy91OQ
----------------------------------------------------
My problem is that I cannot clear the particles when I quit the game. So if I were to force the game to move to the title screen from the pause menu, the particles will stay there thus causing a memory leak.
I can however clear the particles when I die, or when I move to the next room.
Here's my code for how I'm moving to the title screen
Code:
///This is a script
switch (mpos)
{
case 0: //Continue
{
instance_destroy(obj_pausewindow);
instance_destroy(obj_pausearrow);
break;
}
case 1: //Quit
{
room_goto(roomControls);
break;
}
Anyone mind giving me some more knowledge on how this works? I heard about global particles, I tried my hand at that but I couldn't get it to work, is that something I'd need to go with? I'm only using it for this specific world so, does it matter?
Any help is greatly appreciated, thank you.