From: Bill Kelly Date: 2010-03-15T16:17:39+09:00 Subject: Re: Newbie Help : Object Jerome David Sallinger wrote: > > Perhaps if there some games programmers reading this they could let us > know how its done in industry I seem to recall encountering both techniques Ian mentioned in games, many years ago. Definitely the 2D grid-based bucket sort. The the one-dimensional bucket sort based on Y-coordinate sounds familiar too. (Of course, if the balls can all become aligned horizontally very often, then the 1D optimization breaks down.) Note, collision can start to get pretty fancy. If you're moving objects in discrete steps, and their velocity vector(s) have sufficient magnitude, the objects can skip right past one another when they should have collided. So there are various techniques, depending on how accurate your collision detection needs to be. Also, these days, there are a number of pre-existing 2D collision libraries availble. But anyway, you'll need something akin to the approaches Ian mentioned to reduce the number of collision tests per frame. Regards, Bill