📜  在 pygame 中将图像加载为精灵 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:52.225000             🧑  作者: Mango

代码示例2
class Player(pg.sprite.Sprite):

    def __init__(self, pos, image):
        super().__init__()
        self.image = image
        self.rect = self.image.get_rect(center=pos)


player1 = Player((100, 300), IMAGE1)
player2 = Player((300, 300), IMAGE2)