added move function to bodies

This commit is contained in:
Guard13007 2014-10-28 11:40:51 -07:00
parent 80b1f67f9b
commit 91996c4fc5

View File

@ -109,6 +109,17 @@ function body:setPosition(x, y)
end
end
-- move position
function body:move(x, y)
if x then
self.x = self.x + x
end
if y then
self.y = self.y + y
end
self:refresh()
end
-- get x position
function body:getPosition()
return self.x, self.y