diff --git a/examples/gameplay/plateform/actors/player.lua b/examples/gameplay/plateform/actors/player.lua index 84e473a..1c95872 100644 --- a/examples/gameplay/plateform/actors/player.lua +++ b/examples/gameplay/plateform/actors/player.lua @@ -39,7 +39,7 @@ function Player:updateStart(dt) end if (self.isPunching) then - --self:checkHitboxCollisions(self.punchName) + self:checkHitboxesCollisions() end if self.keys["start"].isPressed then diff --git a/gamecore/modules/world/actors/actor2D.lua b/gamecore/modules/world/actors/actor2D.lua index b9fd140..ef96360 100644 --- a/gamecore/modules/world/actors/actor2D.lua +++ b/gamecore/modules/world/actors/actor2D.lua @@ -276,6 +276,12 @@ function Actor2D:addHitbox(name, type, ox, oy, w, h, isSolid) end end +function Actor2D:checkHitboxesCollisions(filter) + for k,v in pairs(self.hitboxes) do + self:checkHitboxCollisionsAtPoint(k, self.x, self.y, filter) + end +end + function Actor2D:checkHitboxCollisions(name, filter) self:checkHitboxCollisionsAtPoint(name, self.x, self.y, filter) end