modules/world: make the move function return variables
This commit is contained in:
parent
a25e178628
commit
05f62a6842
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue