Collision detection in Löve?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Maholain
Prole
Posts: 12
Joined: Tue Jun 23, 2009 4:29 am

Re: Collision detection in Löve?

Post by Maholain »

Sardtok wrote:Have a look at the Body documentation posted above.
There are getters and setters for other physical attributes like velocity which might come in handy.
I'm guessing you're talking about love.physics.body_setVelocity? And what exactly would I use get for? Set I understand...
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Collision detection in Löve?

Post by Robin »

Maybe if you want to know the velocity of a body?
Help us help you: attach a .love.
Maholain
Prole
Posts: 12
Joined: Tue Jun 23, 2009 4:29 am

Re: Collision detection in Löve?

Post by Maholain »

Okay, so do I put the set Velocity in a keypress callback to make something move?

EDIT:So I got the above working. However... how do I stop the velocity after I release the key?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Collision detection in Löve?

Post by Robin »

using a keyreleased callback, and setVelocity(0,0)?
Help us help you: attach a .love.
Maholain
Prole
Posts: 12
Joined: Tue Jun 23, 2009 4:29 am

Re: Collision detection in Löve?

Post by Maholain »

Robin wrote:using a keyreleased callback, and setVelocity(0,0)?
Wow, I'm dumb :o Thanks for the help everyone!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 5 guests