Please give me some advice as to how to use love.physics

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
sladjkf
Prole
Posts: 18
Joined: Mon Mar 02, 2015 7:18 pm

Please give me some advice as to how to use love.physics

Post by sladjkf »

How do you make give an object a velocity cap?
How do you make an object nonrotatable?
Why isn't there a comprehensive love.physics tutorial?
User avatar
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Please give me some advice as to how to use love.physics

Post by ivan »

sladjkf wrote:How do you make give an object a velocity cap?
there already is a 'maxtranslation' threshold but I don't think you can change it from Lua
sladjkf wrote:How do you make an object nonrotatable?
body:setFixedRotation(true)
sladjkf wrote:Why isn't there a comprehensive love.physics tutorial?
take a look at the manual at: http://box2d.org/
User avatar
sladjkf
Prole
Posts: 18
Joined: Mon Mar 02, 2015 7:18 pm

Re: Please give me some advice as to how to use love.physics

Post by sladjkf »

there already is a 'maxtranslation' threshold but I don't think you can change it from Lua
Is there any way to "hack" together a solution?

EDIT:nvm, I figured it out
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Please give me some advice as to how to use love.physics

Post by s-ol »

sladjkf wrote:
there already is a 'maxtranslation' threshold but I don't think you can change it from Lua
Is there any way to "hack" together a solution?

EDIT:nvm, I figured it out
Please post or explain your solution for future reference, people might find this thread later on.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
sladjkf
Prole
Posts: 18
Joined: Mon Mar 02, 2015 7:18 pm

Re: Please give me some advice as to how to use love.physics

Post by sladjkf »

use body:setLinearVelocity() to set the velocity if it exceeds the velocity desired
Post Reply

Who is online

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