diff --git a/gamecore/modules/world/actors/actor2D.lua b/gamecore/modules/world/actors/actor2D.lua index ac56c26..2c234aa 100644 --- a/gamecore/modules/world/actors/actor2D.lua +++ b/gamecore/modules/world/actors/actor2D.lua @@ -30,20 +30,18 @@ local Actor2D = BaseActor:extend() -- Initialise the actor and its base functions function Actor2D:new(world, type, x, y, w, h, isSolid) - Actor2D.super.new(self, world, type) - self:initPhysics(x, y, w, h, isSolid) + Actor2D.super.new(self, world, type, isSolid) + self:initPhysics(x, y, w, h) self:register() end -function Actor2D:initPhysics(x, y, w, h, isSolid) +function Actor2D:initPhysics(x, y, w, h) self:initHitbox(x, y, w, h) self:initMovement() self:setBounceFactor() self:initGravity() - self.isSolid = isSolid or false - self:setFilter() end diff --git a/gamecore/modules/world/actors/baseactor.lua b/gamecore/modules/world/actors/baseactor.lua index 7f91ac9..a513ed7 100644 --- a/gamecore/modules/world/actors/baseactor.lua +++ b/gamecore/modules/world/actors/baseactor.lua @@ -30,8 +30,10 @@ local Timer = require(cwd .. "utils.timer") -- INIT FUNCTIONS -- Initialise the actor and its base functions -function BaseActor:new(world, type) - self.type = type or "" +function BaseActor:new(world, type, isSolid) + self.type = type or "" + self.isSolid = isSolid or false + self:setManagers(world) self:initKeys() self:initTimers()