Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ここに私の質問があります。画面上で連続的に左右に移動したい画像があります。カウントするたびにカウントを表示したい。コードをすべて台無しにする前に、コードをクリーンアップしようとしました。画像が画面の一方の側からもう一方の側に移動するたびにカウントを表示するために追加する必要があるものを誰かが手伝ってくれますか? コードを追加しました。 私のコード
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