diff --git a/gamecore/modules/world/actors/actor2D.lua b/gamecore/modules/world/actors/actor2D.lua index a967c92..1a351e2 100644 --- a/gamecore/modules/world/actors/actor2D.lua +++ b/gamecore/modules/world/actors/actor2D.lua @@ -28,6 +28,10 @@ function Actor2D:update(dt) -- here will be update actions end +function Actor2D:move(newx, newy) + self.world:moveActor(self, newx, newy) +end + function Actor2D:draw() -- here will be update actions end diff --git a/gamecore/modules/world/baseworld.lua b/gamecore/modules/world/baseworld.lua index 6d671da..8436397 100644 --- a/gamecore/modules/world/baseworld.lua +++ b/gamecore/modules/world/baseworld.lua @@ -57,8 +57,8 @@ function BaseWorld:removeActor(actor) end function BaseWorld:moveActor(actor, x, y, filter) - self.actors[actor].x = x - self.actors[actor].y = y + actor.x = x + actor.y = y -- as the baseworld have no collision function, we return empty collision -- datas, but from the same type than bump2D will return return x, y, {}, 0