• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Le Slo

Member
Hello,

I've been playing around with particles for my lasers. I have the following:

-3 Particle types (once for the laser beam, another for a different kind of laser (not relevant now) and a last one for the end of the laser (I will call it laser splash from now)). They are global variables.
-2 objects:
-obj_laser: The blocks that shoots lasers.
-obj_player: The circle.

I want to make the laserblocks and lasers appear when the player is close to them. I managed to do it for the blocks and the laser beams. I tried to apply the method I followed for the laser beams to the laser splashes, but using part_type_alpha2 instead of part_type_alpha1 for aesthetic reasons (the laser splashes fade into transparency, laser's beams don't). This somehow doesn't work.

Example with laser beams fading to opaque:
Code:
   part_type_alpha1(part1,clamp(1-distance_to_object(obj_player)/250,0,1));
   part_type_alpha1(part2,clamp(1-distance_to_object(obj_player)/250,0,1));
    part_type_alpha2(part3,clamp(1-distance_to_object(obj_player)/250,0,1),1);


With this example you can see the splash has some direction and speed. You can see that the transparency of the splash it's correctly displayed (when the player is on the left the nearest laser has a white circle).

Example with laser beams fading to transparent:
Code:
   part_type_alpha1(part1,clamp(1-distance_to_object(obj_player)/250,0,1));
   part_type_alpha1(part2,clamp(1-distance_to_object(obj_player)/250,0,1));
    part_type_alpha2(part3,clamp(1-distance_to_object(obj_player)/250,0,1),0);


Here there is no splash at all there should only be splash when the player is near the object laser, not the laser splash itself. You can see that when the player is near a laser a white circle appears on the splash, but there isn't any path for those particles. Am I missing something? I searched everywhere else and there isn't any other place in the code where the alpha of the part type is being changed, the direction and the speed of the part type are also correctly called. Can anyone find the issue?
 
Top