This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Peter Gr
Posted Jul 27 - Read on Facebook

Hey! I have a game where I need to detect if a falling rock "hits" a draggable ship. I have it working, but wanted to know how I could minimize the number of calculations / event listeners going on in the background.

Current structure (rock is always falling):

rock.on "change:y"
- if ship.x and y overlap with the rock's x and y
-- stuff happens

Would it help to throw in a "Math.round" at some point here?