Page 1 of 1

Glitch out on jumping.

PostPosted: Sun Dec 31, 2006 4:24 am
by Hblade
The code is if (Jump =1)
{
yvelocity -=4;
Jump = 0;
}
BUT! It keeps on repeating the stupid jump, in the air, and I don't have Repeat On either.

PostPosted: Sun Dec 31, 2006 4:26 am
by Hedfone
you have to put the

jump=o
yvelocity-=4;

in a key down event, otherwise, the actor will 'bounce' everytime that jump = 1. (whenever is collides with the ground)

PostPosted: Sun Dec 31, 2006 4:30 am
by Hblade
Right, i got it now, I missed an = sign.
if(Jump==1)
{
yvelocity=-2.8;
Jump=0;
}
Thats the original code. Sorry about that.

PostPosted: Mon Jan 01, 2007 1:19 am
by Joshua Worth
You should use indenting in your program code, to make it easier to read:


Code: Select all
if(Jump==1)
{
    yvelocity=-2.8;
    Jump=0;
}