separating axis theorem in scratch click to drag vertices this only supports triangle hitboxes, but you can assign each trangle to a group and detect collisions only between specific groups in this demo there are two groups (cyan and purple) so you can see more of how it works
all code by me feel free to use this code in any of your projects (with credit ofc) if you find any bugs, please tell me and ill try to fix them as soon as i can its a lot less complex than it looks