sort sprites to fix the z-index