Glitch out on jumping.

Non-platform specific questions.

Glitch out on jumping.

Postby Hblade » Sun Dec 31, 2006 4:24 am

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.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Postby Hedfone » Sun Dec 31, 2006 4:26 am

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)
User avatar
Hedfone
 
Posts: 174
Joined: Mon Jul 31, 2006 9:47 pm
Score: 2 Give a positive score

Postby Hblade » Sun Dec 31, 2006 4:30 am

Right, i got it now, I missed an = sign.
if(Jump==1)
{
yvelocity=-2.8;
Jump=0;
}
Thats the original code. Sorry about that.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Postby Joshua Worth » Mon Jan 01, 2007 1:19 am

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;
}
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest