16 lines
355 B
Plaintext
16 lines
355 B
Plaintext
-- move any colliding Rects to make room for `a`
|
|
move_others = function(a, depth)
|
|
if depth == nil then depth = 0 end
|
|
if depth > 10 then return end
|
|
-- print('move others', a.key)
|
|
for _,d in pairs(Definitions) do
|
|
if d ~= a then
|
|
local msv = collide(a, d)
|
|
if msv then
|
|
move(d, msv)
|
|
A1(d.key)
|
|
move_others(d, depth+1)
|
|
end
|
|
end
|
|
end
|
|
end |