0.8.0 Physics

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
fparedesg
Prole
Posts: 13
Joined: Thu Dec 15, 2011 8:47 am

0.8.0 Physics

Post by fparedesg »

Hey everyone,

I'm trying out the never version of löve, but it's not even detecting basic physics functions. I don't know exactly what changes were made, so I'm not sure what I'm doing wrong. Take, for example, just this full code:

Code: Select all

function love.load()
	shape = love.physics.newRectangleShape(800, 200)
	shape:setDensity(0.5)
end
Once I run it, I get the error that 'setDensity' is a nil value. Why is this?

Also, how do you link a shape to a body? In previous versions, the first argument for new shapes asked for its body, but how does it work now?

Thanks!
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: 0.8.0 Physics

Post by Roland_Yonaba »

Hi,
I have never used love.physics module. But it seems you are using newRectangleShape() and setDensity() correctly.
Seems that setDensity() simply doesn't work. :x
Last edited by Roland_Yonaba on Wed May 16, 2012 5:20 pm, edited 1 time in total.
SudoCode
Citizen
Posts: 61
Joined: Fri May 04, 2012 7:05 pm

Re: 0.8.0 Physics

Post by SudoCode »

Obligatory "don't use love.physics if you just need standard jumping and collision".
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: 0.8.0 Physics

Post by bartbes »

Shapes don't have a density anymore, look at Fixtures.
fparedesg
Prole
Posts: 13
Joined: Thu Dec 15, 2011 8:47 am

Re: 0.8.0 Physics

Post by fparedesg »

Oh..lookitthat, Fixtures. Thanks!!

Also, do you have any idea when they'll update the documentation for 0.8.0?
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: 0.8.0 Physics

Post by Tesselode »

Looks updated to me. Also, make sure you create a world for your physics objects.
User avatar
jradich
Party member
Posts: 100
Joined: Mon Dec 12, 2011 8:44 pm

Re: 0.8.0 Physics

Post by jradich »

Ewww physics?
I'll stick to what I know.
Losing a friend's trust is the fastest way to lose a friend, forever. FOREVER!
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests