I’m making a game about a frog and I’m having trouble making his jump look/feel right. Here’s the code:
function jump( event ) if ( canJump == true ) then canJump = false frog:applyLinearImpulse( 0, -15, frog.x, frog.y ) vx, vy = frog:getLinearVelocity() gx, gy = physics.getGravity() local result = 2 \* -vy / gy print(result) end
But the result I’m getting is about 51 seconds, even though the frog is only off the ground for about 1 second. How can I find the amount of time the frog is actually in the air?