更新 'ship.py'

This commit is contained in:
206530210 2021-06-23 21:23:10 +08:00
parent 2e23796c44
commit ce997db95a
1 changed files with 4 additions and 0 deletions

View File

@ -41,3 +41,7 @@ class Ship(Sprite):
self.centery -= self.ai_settings.ship_speed_factor
if self.moving_down and self.rect.bottom < self.screen_rect.bottom:
self.centery += self.ai_settings.ship_speed_factor
# 根据self.center更新rect对象
self.rect.centerx = self.center
self.rect.centery = self.centery