chore: initialize the hitbox with the physics

This commit is contained in:
Kazhnuz 2020-11-26 20:18:26 +01:00
parent 9993221e0d
commit f30fc6346d
3 changed files with 1 additions and 2 deletions

View file

@ -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()

View file

@ -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)

View file

@ -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()