Merge pull request #11 from qrap/master

added move function to bodies
This commit is contained in:
Tim Anema 2014-10-28 20:50:24 -04:00
commit 2d1d65df4f

View File

@ -109,6 +109,17 @@ function body:setPosition(x, y)
end end
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 -- get x position
function body:getPosition() function body:getPosition()
return self.x, self.y return self.x, self.y