BMAP* bmpSpark = "spark.bmp";


function effectBloodSplatFade(PARTICLE* p)
{
p.size -= (.25+random(.25)) * time_step; // reduce blood splats size with some randomness
p.alpha-=4*time_step; // fade out bloodsplat
p.lifespan = maxv(0,p.alpha); // when alpha reaches <= 0, lifespan = 0, thus ending that particular bloodsplat particle
}

function effectBloodSplat(PARTICLE* p)
{

vec_set(p.vel_x,vector((random(2)-1),(random(2)-1),(.5-random(1)))); // give a little random velocity to each bloodsplat particle

//give a little random start position to each bloodsplat
p.x += random(3)-1.5;
p.y += random(3)-1.5;
p.z += random(3)-1.5;
p.bmap = bmpSpark;
set(p,STREAK|BRIGHT|MOVE); // set particle parameters
p.size=4+random(8); // give each bloodsplat a little random size
p.alpha = 70 + random(15); // give each bloodsplat a little random alpha(visiblilty)

p.gravity = 0.3; // make particles fall down with gravity, not necessary for some effects

//give each bloodsplat a little random red color
p.red = 200 + random(55);
p.green= 20 + random(10);
p.blue = 20 + random(10);

p.event = effectBloodSplatFade; // call the fade event
}

// Somewhere in code that calls effect
...
effect_local(effectBloodSplat,(2+random(4)),my.x,nullvector); // create 2 to 6 blood splats at entity position
...

About as simple as it gets, except for the randomness stuff,
That's all I got for you, hope it helps,
Later,
Loco


Professional A8.30
Spoils of War - East Coast Games