From f30fc6346d6245f08729b309f79bc2f890ad378f Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 26 Nov 2020 20:18:26 +0100 Subject: [PATCH] chore: initialize the hitbox with the physics --- birb/modules/world/actors/actor2D.lua | 1 - birb/modules/world/actors/actor3D.lua | 1 - birb/modules/world/actors/mixins/physics.lua | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/birb/modules/world/actors/actor2D.lua b/birb/modules/world/actors/actor2D.lua index 2f93423..220665f 100644 --- a/birb/modules/world/actors/actor2D.lua +++ b/birb/modules/world/actors/actor2D.lua @@ -43,7 +43,6 @@ local Hitbox = require("birb.modules.world.actors.utils.hitbox2D") function Actor2D:new(world, type, x, y, w, h, isSolid) self:init(world, type) self:initPhysics(x, y, 0, w, h, 0, isSolid) - self:initHitboxes() self:initTimers() self:initSprite() self:initKeys() diff --git a/birb/modules/world/actors/actor3D.lua b/birb/modules/world/actors/actor3D.lua index ec961d6..9fceccc 100644 --- a/birb/modules/world/actors/actor3D.lua +++ b/birb/modules/world/actors/actor3D.lua @@ -45,7 +45,6 @@ local Boxes = require(cwd .. "utils.boxes") function Actor3D:new(world, type, x, y, z, w, h, d, isSolid) self:init(world, type) self:initPhysics(x, y, z, w, h, d, isSolid) - self:initHitboxes() self:initTimers() self:initSprite() self.world:registerShape(self) diff --git a/birb/modules/world/actors/mixins/physics.lua b/birb/modules/world/actors/mixins/physics.lua index 553a1af..f915043 100644 --- a/birb/modules/world/actors/mixins/physics.lua +++ b/birb/modules/world/actors/mixins/physics.lua @@ -21,6 +21,7 @@ function PhysicalActor:initPhysics(x, y, z, w, h, d, isSolid) self.zfrc = 0 self:initGravity() + self:initHitboxes() self:setBounceFactor() self:setFilter()