Last active
January 14, 2019 01:36
-
-
Save southill/7a9d9e94f751f145899d0c74997e3a6e to your computer and use it in GitHub Desktop.
hittest hit test
This file contains 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 hitTestObject(a,b){ | |
var area_0 = [a.x,a.y,66,66]; | |
var area_1 = [b.x,b.y,87,66]; | |
return !(area_0[0] + area_0[2] < area_1[0] | |
|| area_0[0] > + area_1[0] + area_1[2] | |
|| area_0[1] + area_0[3] < area_1[1] || area_0[1] > + area_1[1] | |
+ area_1[3]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment