Skip to content

Instantly share code, notes, and snippets.

@sonic2kk
Last active August 29, 2015 14:25
Show Gist options
  • Save sonic2kk/b89d029c2926f34c15b6 to your computer and use it in GitHub Desktop.
Save sonic2kk/b89d029c2926f34c15b6 to your computer and use it in GitHub Desktop.
Simple Lua function for checking bounding box collisions
function rect_colliding(x1,y1, w1, h1, x2, y2, w2, h2)
return x1 < x2 + w2 and x2 < x1 + w1 and y1 < y2 + h2 and y2 < y1 + h1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment