not perfect, but working collision detection for polygons