Code: Select all
shapes[newbody] = love.physics.newRectangleShape(bodies[newbody],0,0,rx,ry,0)
Here's some of the rest of the code to pair it:
Code: Select all
function love.update()
if _mode == "Game" then
if love.mouse.isDown("l") then
buffer = "\n"
draw = true
if fx == 0 and fy == 0 then
fx,fy = love.mouse.getX(),love.mouse.getY()
end
rx,ry = love.mouse.getX() - fx,love.mouse.getY() - fy
else
draw = false
--I added the next parts and it borked
newbody = #bodies + 1
graphics[#graphics + 1] = {fx,fy,rx,ry}
bodies[newbody] = love.physics.newBody(world,fx,fy,0,10)
shapes[newbody] = love.physics.newRectangleShape(bodies[newbody],0,0,rx,ry,0)
bodies[newbody]:setMassFromShapes()
fx,fy,rx,ry = 0,0,0,0
end
end
end