pygame: drawing order for sprite group with sprite.RenderPlain
问题 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? 回答1: Straightforwardly, you can't: The Group does not keep sprites in any order, so the draw order is arbitrary. Use an OrderedUpdates group instead: This class derives from pygame.sprite.RenderUpdates - Group class that tracks