Love.Physics question! [SOLVED]

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
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Love.Physics question! [SOLVED]

Post by Jeeper »

I was playing around with the love.physics and wanted to make a circle move at a fixed speed towards the right. I tried to use "Body:applyForce" but the problem is that it keeps speeding up and going faster and faster. Is there a way to move at a fixed speed or to limit "Body:applyForce" to not keep applying force once the X velocity is over a certain amount?

Thanks a lot in advance! :3
Last edited by Jeeper on Sat Mar 30, 2013 12:45 am, edited 1 time in total.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Love.Physics question!

Post by Robin »

You could call Body:getLinearVelocity() and only apply force if the horizontal velocity is smaller than a certain number.
Help us help you: attach a .love.
User avatar
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Re: Love.Physics question!

Post by Jeeper »

Robin wrote:You could call Body:getLinearVelocity() and only apply force if the horizontal velocity is smaller than a certain number.
Ah, that is really smart, thanks a lot :D!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 42 guests