0

所以这是我的问题。我有一个图像,我想在屏幕上不断地左右移动。我想每次显示一个计数。我试图在我把它搞砸之前清理我的代码。有人可以帮助我添加我需要添加的内容,以便显示每次图像从屏幕一侧移动到另一侧时的计数吗?我已经添加了代码。 我的代码

4

1 回答 1

0
class moving_image(games.Sprite):
    def __init__(self):
        self.counter = 0

    def update(self):
        if self.right > games.screen.width or self.left < 0:
            self.dx = -self.dx
            self.counter += 1
于 2016-04-10T05:56:39.080 回答