更新 'ship.py'

This commit is contained in:
206530210 2021-06-21 22:29:10 +08:00
parent ad2d4fe536
commit 3da13c9d10
1 changed files with 5 additions and 0 deletions

View File

@ -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: