If u hold space ure ball jumps skyhigh. You could do this fex
var jumping = 0;
function jump()
{
if (event_type == EVENT_FRICTION)
{
if (key_space && !jumping)
{
if (!snd_playing(sound))
{
jumping = 1;
ball_jump.z = 60;
sound = snd_play (impact, 100, 1);
}
}
}
}
function redux()
{
while (1)
{
if (ball_jump.z > 0)
{
ball_jump.z = - 1*time_step;
}
else jumping = 0;
wait(1); // changed from wait(-0.1) = ?
}
}
See what i mean ? I did not test your script, but i guess you know what i meant with the simple change.
Besides that u should combine your redux function with a c_trace. Simple checking Balls.Z != 0 wont work ( fex on steps ).
ex
my_height = c_trace....
if (my_height <= 0) Iam_On_Floor;