Order entities by distance so they draw in the proper order