Skip to content

Instantly share code, notes, and snippets.

@RayPS
Created November 23, 2016 09:27
Show Gist options
  • Save RayPS/c08c9a0a6d96211806aab5c7a306fc52 to your computer and use it in GitHub Desktop.
Save RayPS/c08c9a0a6d96211806aab5c7a306fc52 to your computer and use it in GitHub Desktop.
Framer-2D-Collision-Detection
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
@RayPS
Copy link
Author

RayPS commented Nov 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment