Page 1 of 1

how do you make it so that you can only jump once?

PostPosted: Sun Feb 04, 2007 12:26 am
by Kooldudese
how can you make it so that you can only jump once?
they jump with (yvelocity = -1;) thx

PostPosted: Sun Feb 04, 2007 12:39 am
by Kodo

PostPosted: Sun Feb 04, 2007 12:41 am
by Sgt. Sparky
okay,make a var called Jump(integer) and on the collision on the top side of the ground have this
Code: Select all
Jump = 1;

and when the jumping key is pressed have this script
Code: Select all
if (jump == 1)
{
  yvelocity -= 1;
  Jump = 0;
}

and that should do the trick :D

PostPosted: Sun Feb 04, 2007 12:42 am
by Joshua Worth
make a variable called jumping
Code: Select all
if (jumping == 0) yvelocity = -1;

then make a draw actor:
Code: Select all
jumping = 1;

then make a collision with repeat turned on:
Code: Select all
jumping = 0;


There are many different ways of doing this. This is just one of them

PostPosted: Sun Feb 04, 2007 12:45 am
by Sgt. Sparky
... I just posted somthing like that...... :? :lol: (I just realised that I poseted somthing after sombody else posted somthing bout' the same thing[only links]) :lol:

PostPosted: Sun Feb 04, 2007 12:53 am
by Kodo
Yup, only links. The code you guys posted is on most of those links. It also goes to show how many times the same question is asked and answered. We might as well add a dedicated forum called 'How to jump' ;)

PostPosted: Sun Feb 04, 2007 1:03 am
by Sgt. Sparky
yeah :D makslane should have that in the platform game stuff for GE :D