📜  RPG 播放器类__init__ - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:39.097000             🧑  作者: Mango

代码示例1
class Player(pygame.sprite.Sprite):
    def __init__(self):
        super().__init__()
        self.image = pygame.image.load("Player_Sprite_R.png")
        self.rect = self.image.get_rect()
 
        # Position and direction
        self.vx = 0
        self.pos = vec((340, 240))
        self.vel = vec(0,0)
        self.acc = vec(0,0)
        self.direction = "RIGHT"