Page 1 of 1

Need help with jump cooldown

Posted: Wed Jan 02, 2013 4:41 pm
by Echamiq
Hi everyone,

I'm trying to make my first game, it's now just a block moving right, left and up using physics and :applyForce(), but I want my lil' cube to jump only when he is on something. So is there a way for me to get the vertical velocity and the vertical velocity only?

Thanks in advance,

-Echamiq

Re: Need help with jump cooldown

Posted: Fri Jan 04, 2013 9:19 pm
by mathacka
Correct me if I'm wrong, but wouldn't it be:

Code: Select all

velX, velY = player.body:getLinearVelocity()
-- Then just use the velY
?