Here is an example:
Code:
// eff_blood.c
BMAP* eff_bloodBmap 	= "blood.tga";

function eff_blood_spec_fun(PARTICLE* p) {
    p.alpha -= 6 *time_step;
    if(p.alpha < 0) { p.alpha = 0; p.lifespan = 0; }
}

function eff_bloodspezial(PARTICLE* p){
    p.blue = 70;
    p.green = 70;
    p.red = 90;
    p.bmap = eff_bloodBmap;  //the effect bitmap
    p.vel_x = random(2) - 1;
    p.vel_y = random(2) - 1;
    p.vel_z = random(4);
    p.size = 3+random(2);
    p.alpha = 30;
    p.gravity=1+random(.5);
    set(p, BRIGHT | MOVE | TRANSLUCENT);
    p.event = eff_blood_spec_fun;
}

function eff_blood(var* p_pos, var p_cnt){
	effect(eff_bloodspezial, p_cnt, p_pos[0], nullvector);
}


[edit]If you shoot at the enemy and he got hit you can use the target-vector to locate the position:

eff_blood(target.x, 10);

Last edited by mercuryus; 02/18/09 09:07.