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: