import { rectangleIntersection } from "https://deno.land/x/tui@2.1.11/src/utils/mod.ts";
Calculate intersection between two rectangles
When data
is set to true it returns:
- collision rectangle when they collide
- false when they don't
Otherwise it simply returns boolean whether they collide
Don't hold onto intersection object reference that gets returned!
It gets reused to save CPU usage and minimize GC.