function jump()
{
if (event_type == EVENT_FRICTION)
{
if (key_space)
{
if (!snd_playing(sound))
{
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;
}
wait(-0.1);
}
}
function main()
{
pXent_setcollisionflag(ball, NULL, NX_NOTIFY_ON_TOUCH);
ball.event = jump;
redux();
while (1)
{
pXent_addvelcentral(ball, ball_jump);
}
}