Need help with jump cooldown

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Echamiq
Prole
Posts: 6
Joined: Wed Dec 26, 2012 5:31 pm

Need help with jump cooldown

Post 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
Attachments
loveq.love
The .love
(1.64 KiB) Downloaded 111 times
mathacka
Prole
Posts: 8
Joined: Tue Sep 25, 2012 7:45 pm

Re: Need help with jump cooldown

Post 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
?
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests