modules/world: refactor hitbox initialization outside of initPhysics
This commit is contained in:
parent
86b1368a6e
commit
1e42fac57c
1 changed files with 3 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue