From AUM 78::

Quote:
Q: Does anyone know how to put a fire particle effect behind the tail of a jet?

A: There you go.



BMAP* fire_tga = "fire.tga";



function fade_fire(PARTICLE *p)

{

p.alpha -= 4 * time_step; // fade out the fire particles

if (p.alpha < 0)

p.lifespan = 0;

}



function fire_effect(PARTICLE *p)

{

p->vel_x = 1 - random(2);

p->vel_y = 1 - random(2);

p->vel_z = 1 + random(1);

p.alpha = 25 + random(50);

p.bmap = fire_tga;

p.size = 25; // gives the size of the fire particles

p.flags |= (BRIGHT | MOVE);

p.event = fade_fire;

}



action my_jet() // attach this action to your plane

{

VECTOR jet_offset;

// put your own code here

// ........................

while (1)

{

// put your own jet flight code here

// the example below simply makes the plane fly in a circle

c_move (my, vector(20 * time_step, 0, 0), nullvector, IGNORE_PASSABLE | GLIDE);

my.pan += 2 * time_step; // 2 sets the radius of the circle

// end of the simply flying example code



// the jet particle effect code starts below

// place the particle jet at the proper position, play with these values

vec_set(jet_offset.x, vector(-100, -10, -20));

vec_rotate(jet_offset.x, my.pan);

vec_add(jet_offset.x, my.x);

effect(fire_effect, 5, jet_offset.x, nullvector); // generate 5 fire particles each frame

wait (1);

}

}


Hope this is what u want

Last edited by bk9iq; 07/28/10 00:47.