maybe you could tell me how what your saying fits into the context of what I am doing. I start the particle effect when pressing f1 but I cant get it to stop when release the key.
here is the the code:
#include <acknex.h>
#include <default.c>
#include <atypes.h>
//////////////////////////////
VECTOR* vTemp;
function p_fountain(PARTICLE* p)
{
set(p, MOVE | BRIGHT);
}
void start_particle_while_key(int key, VECTOR* vec)
{
while(1)
{
effect(p_fountain,maxv(1,40*time_step),vector(0,0,0),vector(0,0,4));
wait(1);
}
//stop effect code here I would think
}
function key_down(key) //captures ALL key presses
{
switch(key)
{
case 59:
start_particle_while_key(59, vTemp);
break;
}
}
function main()
{
on_anykey = key_down;//tell any key press to call this function
level_load(NULL);
vec_set(camera.x,vector(-150,0,50));
}
Last edited by ncc1701d; 02/03/10 08:41.