Algorithm to detect sprites in a game.