The particle is "smeared" along
a line given by its velocity vector and starting at its position.
Normally used for continuous rays or trails.
with the BRIGHT flag, lines of light can be created this way for laser,
tracer bullet, vapor or light trail effects.
Like BEAM, but stretches the particle along its velocity vector, instead
of smearing it.
gives the effect a motion blur like appearance.
flag, particles only
When one of these flags are set, instancing can not be used for accelerating particle rendering.
- A8.4 Through particle_mode a 2D or 3D mode can be selected for BEAM and STREAK. In 2D mode, beams are generated by drawing many particles over each other, resulting in a slightly different looking (and slower) effect. 2D mode is not supported in isometric views.
For vapor trails, use the BEAM flag and set the velocity vector to the difference of the current emitter position
to its position in the last frame.
function p_alphafade(PARTICLE *p)
p.alpha -= p.skill_a*time_step;
if (p.alpha <= 0) p.lifespan = 0;
function p_trace(PARTICLE *p)
p.size = 2;
p.skill_a = 1; // fade factor
p.event = p_alphafade;
// entity that runs in circles and leaves a vapor trail
var dist = 0,radius = 10,sign = 1;
dist += 30*time_step;
radius += sign*random(3)*time_step; // change radius randomly
if (radius > 150) sign = -1;
else if (radius < 30) sign = 1;
my.x = radius*sin(dist);
my.y = radius*cos(dist);
vec_set(sky_color,vector(50,1,1)); // dark blue
video_window(NULL,NULL,0,"Vapor trail demo");
effect, lifespan, velocity, gravity, size, alpha, blue, bmap,
BRIGHT, TRANSLUCENT, MOVE,