z-sorting for sprites