sort sprites by z-index before drawing