donderdag 31 maart 2011

Selecting a Arraylist for object collision detection.

I read about the arraylist being used for speeding up collision detection in games. By adding objects into the arraylist that are near the player and looping/iterating through that list you do not have to check every object in the game. The arraylist item of a game object that leaves the direct vicinity of a player should be removed.

In my last games I looped through every game item with every other game item and checked the distance with the collided area before doing more checks with it.

Geen opmerkingen:

Een reactie posten

Opmerking: Alleen leden van deze blog kunnen een reactie posten.