Re: My ongoing newbie questions
Posted: Mon Jun 22, 2009 10:28 pm
And another...
I have a physics body as the ground, with the player standing on it. How do I detect whether the player is touching the ground, to determine whether he can jump? Or is there a better way?
(At the moment, the player can keep jumping whilst in the air, as if they're flapping wings and flying upwards...)
[Edit] I've kind of hacked a solution to this, by checking the Y position of the player when they press the jump key, and not making him jump if he's too high. It seems quite crap though - is it more standard to do some kind of collision check between the player and the ground, and base it off that?
I have a physics body as the ground, with the player standing on it. How do I detect whether the player is touching the ground, to determine whether he can jump? Or is there a better way?
(At the moment, the player can keep jumping whilst in the air, as if they're flapping wings and flying upwards...)
[Edit] I've kind of hacked a solution to this, by checking the Y position of the player when they press the jump key, and not making him jump if he's too high. It seems quite crap though - is it more standard to do some kind of collision check between the player and the ground, and base it off that?