Pygame 角色留下踪迹

问题描述

你好,我在 Pygame 中制作了一个简单的移动系统,但是当角色(圆圈)移动时,它会留下一条轨迹。 player.update() 也会绘制玩家,轨迹很微妙,就像闪烁一样,它只留下轨迹的 1 个圆圈(不,我不会画两次圆圈)。我也在其他显示器上测试过,问题依然存在。看看这个视频。 https://www.dropbox.com/s/pjcy6aix2x5lwy2/2021-02-20%2017-57-30.mp4?dl=0

disp = pygame.display
win = disp.set_mode((1680,1050)),pygame.FULLSCREEN)

-------blablabla inbetween--------

while True:
    win.fill((51,51,51))

    for events in pygame.event.get():
        if events.type == pygame.QUIT: quit()

    player.update()
    disp.update()
    pygame.time.Clock().tick(60)

根据您的要求,这里是 player.update() 并且我没有多次调用 disp.update() 方法

    def update(self):
        self.move(direction())
        self.vel.sum(self.acc)
        self.pos.sum(self.vel)
        self.draw()

        self.vel.multiply(vector(0.9,0.9))
        self.acc.substract(self.acc)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)