2D collision detection and resolving library