https://turbowarp.org/997805380?hqpen&fps=60 https://mirror.turbowarp.xyz/?hqpen&fps=60#997805380
This puts the objects on a grid of cells, so the object only checks if its colliding with the objects within its cell and its neighboring cells instead of looping through every object which decreases the amount of checks monumentally. With 500 objects and no optimization there would be 250,000 checks every frame. With my optimization there are only around 600 checks per frame.