modules/world: make the move function return variables

This commit is contained in:
Kazhnuz 2019-04-22 12:09:28 +02:00
parent a25e178628
commit 05f62a6842

View file

@ -89,12 +89,13 @@ function Actor2D:setFilter()
end
function Actor2D:autoMove(dt)
self:move(self.x + self.xsp * dt, self.y + self.ysp * dt)
local newx, newy, cols, colNumber = self:move(self.x + self.xsp * dt, self.y + self.ysp * dt)
end
function Actor2D:move(newx, newy)
function Actor2D:move(dx, dy)
local cols, colNumber
self.x, self.y, cols, colNumber = self.world:moveActor(self, newx, newy, self.filter)
return self.x, self.y, cols, colNumber
end
-- DRAW FUNCTIONS