F
Freppe
Guest
After setting up at trail for my spacecraft I wanted the particles to pause along with the other instances. I used part_system_automatic_update() for this. I set it up in my pause event so that whenever the instances were deactivated the function turned of the updates. When the instances were activated again the function were to set updates to true again but for some reason it didn't. I tried not disabling the particles object and all but nothing seems to work. The particles won't turn on again.
Here's the pause objects step event:
Here is the particle objects create event:
And the particle objects step event:
What it looks like after resuming the game:
Here's the pause objects step event:
Code:
if (!pause)
{
pause = 1;
with (oParticles) part_system_automatic_update(partTrail_sys,false);
instance_deactivate_layer("Instances");
instance_create_depth(0,0,-100,oMenu);
with (oMenu) menu[0] = "Resume";
}
else
{
pause = 0;
instance_activate_layer("Instances");
with (oParticles) part_system_automatic_update(partTrail_sys,true);
instance_destroy(oMenu);
}
Code:
//Particle System
partTrail_sys = part_system_create();
part_system_depth(partTrail_sys,200);
//Particle
partTrail = part_type_create();
part_type_sprite(partTrail,sTrail,true,true,false);
part_type_scale(partTrail,1,1);
part_type_size(partTrail,0.5,0.5,-0.005,0);
part_type_alpha2(partTrail,1,0.5);
part_type_speed(partTrail,0,0,0,0);
part_type_gravity(partTrail,0,90);
part_type_life(partTrail,room_speed*5,room_speed*5);
part_type_blend(partTrail,false);
//Particle Emitter
partTrailLeft_emit = part_emitter_create(partTrail_sys);
partTrailRight_emit = part_emitter_create(partTrail_sys);
leftX = oPlayer.x + lengthdir_x(30,oPlayer.image_angle + 155);
leftY = oPlayer.y + lengthdir_y(30,oPlayer.image_angle + 155);
rightX = oPlayer.x + lengthdir_x(30,oPlayer.image_angle + 205);
rightY = oPlayer.y + lengthdir_y(30,oPlayer.image_angle + 205);
part_emitter_region(partTrail_sys,partTrailLeft_emit,leftX,leftX,leftY,leftY,ps_shape_ellipse,ps_distr_gaussian);
part_emitter_region(partTrail_sys,partTrailRight_emit,rightX,rightX,rightY,rightY,ps_shape_ellipse,ps_distr_gaussian);
part_emitter_stream(partTrail_sys,partTrailLeft_emit,partTrail,4);
part_emitter_stream(partTrail_sys,partTrailRight_emit,partTrail,4);
Code:
part_emitter_region(partTrail_sys,partTrailLeft_emit,leftX,leftX,leftY,leftY,ps_shape_ellipse,ps_distr_gaussian);
part_emitter_region(partTrail_sys,partTrailRight_emit,rightX,rightX,rightY,rightY,ps_shape_ellipse,ps_distr_gaussian);
Attachments
-
20.3 KB Views: 3