now lets use simple logic for falling and end of falling

Code:
vars...

function blah()
{
var last_z=0;
.....
while(..)
{
...... 
last_z=my.z;
c_trace(....)
if(a drop below)
grav = -50*time_step;
else
grav = 0;

c_move(....vector(x,x,grav)..)
if(grav) // unneeded check
if(my.z<last_z) // did the player drop?
{
if(last_z-my.z == grav) // did you fall unchecked
 // or
if(last_z-my.z > some measure) // did you drop more then a foot step??
{
  in_air = TRUE;
  if(!t_start)
  t_start=total_secs;
}
}
if(!grav) // c_trace found ground
{
if(my.z >= last_z)
{
  if(t_start)
{
  in_air = FALSE;
  t_end=total_secs;
  time_elapsed=t_end-t_start;
  t_start=0;
}
}
my.health -=time_elapsed*my.fall_damage;
time_elapsed=0;
}
}
}



Blah blah blah.... You'll never really learn this way. Blah Blah, I'm a lite-c vampire Blah Blah

lol

Last edited by Malice; 12/18/15 23:53.