From 05f62a6842ecb0a8871aa664841849dd638ad7da Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Mon, 22 Apr 2019 12:09:28 +0200 Subject: [PATCH] modules/world: make the move function return variables --- gamecore/modules/world/actors/actor2D.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gamecore/modules/world/actors/actor2D.lua b/gamecore/modules/world/actors/actor2D.lua index 9273acc..4879544 100644 --- a/gamecore/modules/world/actors/actor2D.lua +++ b/gamecore/modules/world/actors/actor2D.lua @@ -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