MOVE
If this flag is set, the particle moves with its velocity vector,
and accelerates with its gravity acceleration.
Type:
flag, particles only
Example (lite-C):
// helper function: sets the vector to random direction and length
function vec_randomize(var* vec,var range)
{
vec[0] = random(1) - 0.5;
vec[1] = random(1) - 0.5;
vec[2] = random(1) - 0.5;
vec_normalize(vec,random(range));
}
// helper function: fades out a particle
function part_alphafade(PARTICLE* p)
{
p.alpha -= 2*time_step;
if (p.alpha <= 0) p.lifespan = 0; // remove particle when faded out
}
//particle function: generates a fading explosion into vel direction
function effect_explo(PARTICLE* p)
{
VECTOR v;
vec_randomize(v,10);
vec_add(p.vel_x,v);
set(p,TRANSLUCENT|BEAM|BRIGHT|MOVE);
p.alpha = 25 + random(25);
p.bmap = scatter_tga;
p.event = part_alphafade; // change to a shorter, faster function
}
...
vec_scale(normal,10); // produce an explosion into the normal direction
effect(effect_explo,1000,my.x,normal);
See also:
lifespan, velocity, gravity, size, alpha, blue, bmap, BRIGHT, TRANSLUCENT, BEAM, skill