Created
January 27, 2012 22:52
-
-
Save vinniefranco/1691400 to your computer and use it in GitHub Desktop.
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 collision_test( obj1, obj2 ) | |
var is_colliding = false; | |
if ( obj1.x < obj2.x + obj2.w && | |
obj1.x + obj1.w > obj2.x && | |
obj1.y < obj2.y + obj2.h && | |
obj1.y + obj1.h > obj2.y ) { | |
is_colliding = true; | |
} | |
return is_colliding; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment