Last active
August 29, 2015 14:25
-
-
Save sonic2kk/b89d029c2926f34c15b6 to your computer and use it in GitHub Desktop.
Simple Lua function for checking bounding box collisions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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