integrated the mirroring part
This commit is contained in:
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user