integrated the mirroring part

This commit is contained in:
2021-05-08 17:33:00 +02:00
parent 686f085f5b
commit 050157a47e
2 changed files with 28 additions and 1 deletions

View File

@@ -6,7 +6,8 @@ local CONST_ITERATIONS_RESOLVE = 1
local Crates = {
world = nil,
player = nil,
list = { }
list = { },
attached = { }
}
local Crate = { }
@@ -55,11 +56,16 @@ function Crates:update(dt)
curContact = self.list[key].contact
self.world:addJoint('revolute', self.player.collider, self.list[key].collider, curContact.x, curContact.y, true)
self.list[key].resolver = nil
table.insert(self.attached, self.list[key])
end
end
end
end
function Crates:getAttached()
return self.attached
end
return setmetatable(Crates, {
__call = function(_, ...) return new(...) end
})