Page 1 of 1

triple jump?

PostPosted: Sat Jun 28, 2008 4:01 am
by BlarghNRawr
how can i make my character only jump 3 times (and only 2 times in the air) Then have jump disabled? :?:

Re: triple jump?

PostPosted: Sat Jun 28, 2008 2:29 pm
by asmodeus
Do it with a variable:
Code: Select all
// create actor event
int can_jump = 3;   // 3 for three jumps in the air

Code: Select all
// pressing the jump button
if(can_jump!=0)
{
    yvelocity = -10;   // let the Actor jump
    can_jump -= 1;
}

and when the Actor collides the ground, set can_jump to 3 again.