elaborate a "collision".
Making a check between 10 objects per frame by normal means will run through 55 checks unless you use a way to partition the objects to reduce that using something, like a quadtree. The "proper way" depends on what your application is. With such a small amount of objects you don't have to be super-efficient. You may want to use a different container, though, since lists aren't a great way to make comparisons between all objects contained within them due to the way you need to access them. An array or Stack<T> would be better. Then, you can check using a nested loop. Pseudocode:
For local i:Int = 0 until list.Length -1
For local j:Int = i+1 until list.Length
If list[i].CollidesWith( list[j] ) Then 'do collision code here
Next
Next
|