atlantis/physics.lua
2021-01-06 21:00:30 -05:00

9 lines
248 B
Lua

local physics = {
}
function physics.boxCollide(a, b)
return ((a.x > b.x and a.x < b.x + b.width) or (a.x <= b.x and b.x < a.x + a.width)) and ((a.y > b.y and a.y < b.y + b.height) or (a.y <= b.y and b.y < a.y + a.height))
end
return physics