if(key_o)
{
show_debug();
}
The problem with this is that it detects the key press every frame and runs the function each time. Is there a good method for only detecting the key press and then waiting for the release before running again?
I've been using somthing along these lines, but it seems sloppy and requires a lot of varriables.
if(!key_space)
{
jumping=0;
}
// Jump
if(key_space)
{
if(!jumping)
{
vec_set(temp, my_entity.x);
temp.z -= 5000;
if(c_trace (my_entity.x,temp,IGNORE_ME|IGNORE_PASSABLE|IGNORE_MODELS|IGNORE_SPRITES) <= 25)
{
phent_addvelcentral(my_entity,vector(0,0,250));
}
}
jumping=1;
}
This just seems like one of those things with a simple solution that I just dont know about yet.
Last edited by jfizer; 08/31/07 17:54.