chore: prepare for division in mixins
This commit is contained in:
parent
730d89a76c
commit
b97d320dc7
4 changed files with 13 additions and 13 deletions
|
@ -22,17 +22,17 @@
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local cwd = (...):gsub('%.actor2D$', '') .. "."
|
local BaseActor = require("birb.modules.world.actors.mixins.base")
|
||||||
local BaseActor = require(cwd .. "baseactor")
|
local Actor2D = Object:extend()
|
||||||
local Actor2D = BaseActor:extend()
|
Actor2D:implement(BaseActor)
|
||||||
|
|
||||||
local Hitbox = require(cwd .. "utils.hitbox2D")
|
local Hitbox = require("birb.modules.world.actors.utils.hitbox2D")
|
||||||
|
|
||||||
-- INIT FUNCTIONS
|
-- INIT FUNCTIONS
|
||||||
-- Initialise the actor and its base functions
|
-- Initialise the actor and its base functions
|
||||||
|
|
||||||
function Actor2D:new(world, type, x, y, w, h, isSolid)
|
function Actor2D:new(world, type, x, y, w, h, isSolid)
|
||||||
Actor2D.super.new(self, world, type, x, y, 0, w, h, 0, isSolid)
|
self:init(world, type, x, y, 0, w, h, 0, isSolid)
|
||||||
self:initHitboxes()
|
self:initHitboxes()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,9 @@
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local cwd = (...):gsub('%.actor3D$', '') .. "."
|
local cwd = (...):gsub('%.actor3D$', '') .. "."
|
||||||
local BaseActor = require(cwd .. "baseactor")
|
local BaseActor = require("birb.modules.world.actors.mixins.base")
|
||||||
local Actor3D = BaseActor:extend()
|
local Actor3D = Object:extend()
|
||||||
|
Actor3D:implement(BaseActor)
|
||||||
|
|
||||||
local Hitbox = require(cwd .. "utils.hitbox3D")
|
local Hitbox = require(cwd .. "utils.hitbox3D")
|
||||||
local Boxes = require(cwd .. "utils.boxes")
|
local Boxes = require(cwd .. "utils.boxes")
|
||||||
|
@ -33,7 +34,7 @@ local Boxes = require(cwd .. "utils.boxes")
|
||||||
-- Initialise the actor and its base functions
|
-- Initialise the actor and its base functions
|
||||||
|
|
||||||
function Actor3D:new(world, type, x, y, z, w, h, d, isSolid)
|
function Actor3D:new(world, type, x, y, z, w, h, d, isSolid)
|
||||||
Actor3D.super.new(self, world, type, x, y, z, w, h, d, isSolid)
|
self:init(world, type, x, y, z, w, h, d, isSolid)
|
||||||
self:initHitboxes()
|
self:initHitboxes()
|
||||||
self.world:registerShape(self)
|
self.world:registerShape(self)
|
||||||
self.boxes = Boxes
|
self.boxes = Boxes
|
||||||
|
|
|
@ -22,16 +22,13 @@
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local cwd = (...):gsub('%.baseactor$', '') .. "."
|
|
||||||
local BaseActor = Object:extend()
|
local BaseActor = Object:extend()
|
||||||
|
local Sprite = require("birb.modules.world.actors.utils.sprites")
|
||||||
local Timer = require(cwd .. "utils.timer")
|
|
||||||
local Sprite = require(cwd .. "utils.sprites")
|
|
||||||
|
|
||||||
-- INIT FUNCTIONS
|
-- INIT FUNCTIONS
|
||||||
-- Initialise the actor and its base functions
|
-- Initialise the actor and its base functions
|
||||||
|
|
||||||
function BaseActor:new(world, type, x, y, z, w, h, d, isSolid)
|
function BaseActor:init(world, type, x, y, z, w, h, d, isSolid)
|
||||||
self.type = type or ""
|
self.type = type or ""
|
||||||
self.isSolid = isSolid or false
|
self.isSolid = isSolid or false
|
||||||
self.depth = 0
|
self.depth = 0
|
|
@ -117,6 +117,8 @@ function Hitbox2D:draw()
|
||||||
local x, y = self:getPosition()
|
local x, y = self:getPosition()
|
||||||
love.graphics.setColor(self.debug.r, self.debug.g, self.debug.b, 1)
|
love.graphics.setColor(self.debug.r, self.debug.g, self.debug.b, 1)
|
||||||
utils.graphics.box(x, y, self.w, self.h)
|
utils.graphics.box(x, y, self.w, self.h)
|
||||||
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
|
love.graphics.points(x, y)
|
||||||
utils.graphics.resetColor()
|
utils.graphics.resetColor()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue