A JavaScript library for detecting collisions