From 3da13c9d10a66a6eac0e80e6e45f93f66a994125 Mon Sep 17 00:00:00 2001 From: 206530210 <2242905818@qq.com> Date: Mon, 21 Jun 2021 22:29:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'ship.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ship.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ship.py b/ship.py index acaa59d..645e65e 100644 --- a/ship.py +++ b/ship.py @@ -28,4 +28,9 @@ class Ship(Sprite): self.moving_left = False self.moving_up = False self.moving_down = False + + def update(self): + """根据移动标志调整飞船的位置""" + # 更新飞船的center值,而不是rect + if self.moving_right and self.rect.right < self.screen_rect.right: