info=Others have done it, but I wanted to try my hand at a grid-based collision detection system. The idea is that when you have many objects, you only need to check for collisions for objects that are in adjacent grid cells. While it takes a lot more setup, you can handle many more objects because you are doing a lot less checking. Anyway, here's a start, with a grid and some objects and visible indication of which grid each is on.