Hi,
I have tried to use Box2D to bounce a ball on a platform.
The problem is that the ball seems to hit an invisible platform and bounce some 20 pixels above the actual platform.
Any suggestion is welcome!
love.physics.setMeter(64)
local world = love.physics.newWorld(0, 9.8 * 64, true)
Hey I think most likely the problem is the way you are drawing your rectangle. I believe if you switch that with love.graphics.polygon("fill",objects.ball.shape:getPoints()) it would work and the reason for this is that the bodies x and y for a rectangle is the center if I'm not mistaken so when you try to draw you draw it wrong. Also if your going to be using box2d I recommend using a debug draw lib. If you google "love2d box2d debug draw" you should find one. A debug draw lib can help figure out why certain things are not working right
The x, y positions you're getting are the center of the box2d body, meaning you're drawing from the center position 800 units to the right and then 50 down, leaving 400 units left and 25 units up unaccounted for, which seems to be the behavior you're describing. To fix you should just do: