Я пытаюсь создать игру, в которой основной объект (мотоцикл) остается неподвижным, но мир вокруг основного объекта движется (создавая иллюзию движения камеры. Я могу получить иллюстрацию земли (зеленый прямоугольник)внизу), но физический объект на земле остается неподвижным. На рисунке ниже видно, что анимация земли сместилась, но мотоцикл все еще лежит на ней. 
Если вы отодвинете основной объект назад, вы упадете с обратной стороны экрана.
Мой код ниже
main.lua
require("Camera")
function love.load()
love.physics.setMeter(64) --the height of a meter our worlds will be 64px
world = love.physics.newWorld(0, 9.81*64, true) --create a world for the bodies to exist in with horizontal gravity of 0 and vertical gravity of 9.81
objects = {} -- table to hold all our physical objects
objects.ground = {}
ground = {}
ground.x = 1700/2 + Camera.x
ground.y = 1000-50 + Camera.y
ground.width = 1700
ground.height = 50
ground.body = love.physics.newBody(world, ground.x, 1000-50/2, "static") --remember, the shape (the rectangle we create next) anchors to the body from its center, so we have to move it to (1700/2, 1000-50/2)
ground.shape = love.physics.newRectangleShape(ground.width, ground.height) --make a rectangle with a width of 1700 and a height of 50
ground.fixture = love.physics.newFixture(ground.body, ground.shape, 1); --attach shape to body, give it a density of 1.
table.insert(objects.ground, ground)
--creating the motorcycle
objects.ball = {}
objects.ball.x = 1700/2
objects.ball.y = 1000/2
objects.ball.width = 100
objects.ball.height = 50
objects.ball.body = love.physics.newBody(world, objects.ball.x, objects.ball.y, "dynamic") --place the body in the center of the world and make it dynamic, so it can move around
objects.ball.shape = love.physics.newRectangleShape(objects.ball.width, objects.ball.height) --the ball's shape has a radius of 20
objects.ball.fixture = love.physics.newFixture(objects.ball.body, objects.ball.shape, 1) -- Attach fixture to body and give it a density of 1.
objects.ball.img = love.graphics.newImage('images/motorcycle.png')
--initial graphics setup
love.graphics.setBackgroundColor(0.41, 0.53, 0.97) --set the background color to a nice blue
love.window.setMode(1700, 1000) --set the window dimensions to 650 by 650
end
function love.update(dt)
world:update(dt) --this puts the world into motion
Camera.update(dt)
end
function love.draw()
love.graphics.setColor(0.28, 0.63, 0.05) -- set the drawing color to green for the ground
for _, groundPiece in pairs(objects.ground) do
love.graphics.rectangle("fill", groundPiece.x - 850 - Camera.x, groundPiece.y - Camera.y, groundPiece.width, groundPiece.height) -- draw a "filled in" polygon using the ground's coordinates
end
love.graphics.draw(objects.ball.img, objects.ball.body:getX(), objects.ball.body:getY()-(objects.ball.height/objects.ball.img:getHeight())/2, objects.ball.body:getAngle(), objects.ball.height/objects.ball.img:getHeight())
end
Camera.lua
Camera = {
x = 0,
y = 0
}
function Camera.update(dt)
if love.keyboard.isDown("right") then --RIGHT ARROW BUTTON IS DOWN then
Camera.x = Camera.x + 5
elseif love.keyboard.isDown("left") then
Camera.x = Camera.x - 5
end
if love.keyboard.isDown("up") then
Camera.y = Camera.y - 5
elseif love.keyboard.isDown("down") then
Camera.y = Camera.y + 5
end
end
.
.
.
У меня есть похожий проект здесь где я смог нарисовать линии на экране и заставить их двигаться движениями камеры. Я не понимаю, что я делаю по-другому в этом новом проекте.