Created
November 23, 2016 09:27
-
-
Save RayPS/c08c9a0a6d96211806aab5c7a306fc52 to your computer and use it in GitHub Desktop.
Framer-2D-Collision-Detection
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
cd = (a, b, c)-> | |
if a.x < b.x + b.width and | |
a.x + a.width > b.x and | |
a.y < b.y + b.height and | |
a.height + a.y > b.y | |
c() | |
# a: Layer A | |
# b: Layer B | |
# c: Callback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Demo: http://share.framerjs.com/pt5jpgxo2805/