Skip to content

Instantly share code, notes, and snippets.

@darkf
Created December 26, 2014 10:38
Show Gist options
  • Save darkf/4d07a64190f24b4efe21 to your computer and use it in GitHub Desktop.
Save darkf/4d07a64190f24b4efe21 to your computer and use it in GitHub Desktop.
AABB Box Collision Test
// So I don't lose it
function boxCollide(a, b) {
if ((a.y+a.h <= b.y) || (a.y >= b.y+b.h)) return false;
if ((a.x+a.w <= b.x) || (a.x >= b.x+b.w)) return false;
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment