I’ve got a sprite group which needs to be drawn in a certain order so its sprites overlap as they should.
However even when sorting the group using operator module function (sorted(self.sprites, key=attrgetter(‘y’,’x’)) the order is wrong.
How can I fix this behaviour?
Straightforwardly, you can’t:
Use an OrderedUpdates group instead:
Alternatively, you can keep different ‘layers’ of sprites in different groups, keeping the order of groups correct.