modules/world: refactor hitbox initialization outside of initPhysics

This commit is contained in:
Kazhnuz 2019-05-05 21:29:49 +02:00
parent 86b1368a6e
commit 1e42fac57c

View file

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