From 1e42fac57c4da42e07ee3975fe228089f0156fdb Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 5 May 2019 21:29:49 +0200 Subject: [PATCH] modules/world: refactor hitbox initialization outside of initPhysics --- gamecore/modules/world/actors/actor2D.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gamecore/modules/world/actors/actor2D.lua b/gamecore/modules/world/actors/actor2D.lua index 2c234aa..2f16d3a 100644 --- a/gamecore/modules/world/actors/actor2D.lua +++ b/gamecore/modules/world/actors/actor2D.lua @@ -31,13 +31,12 @@ local Actor2D = BaseActor:extend() function Actor2D:new(world, type, x, y, w, h, isSolid) Actor2D.super.new(self, world, type, isSolid) - self:initPhysics(x, y, w, h) + self:initHitbox(x, y, w, h) + self:initPhysics() self:register() end -function Actor2D:initPhysics(x, y, w, h) - self:initHitbox(x, y, w, h) - +function Actor2D:initPhysics() self:initMovement() self:setBounceFactor() self:initGravity()