modules/world: put solidity initialization into baseactor
This commit is contained in:
parent
11fcc4cf99
commit
86b1368a6e
2 changed files with 7 additions and 7 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue