外星人

This commit is contained in:
206530217 2021-06-19 13:06:59 +08:00
parent 28ce7136f8
commit 71ed243eb6
1 changed files with 2 additions and 0 deletions

View File

@ -12,6 +12,8 @@ class Alien(Sprite):
self.ai_settings = ai__settings
# 加载外星人图像并设置其rect属性
self.image = pygame.image.load('images/alien.png')
self.rect=self.image.get_rect()
# 每个外星人最初都在屏幕左上角附件
self.rect.x = self.rect.width
self.rect.y = self.rect.height
# 储存外星人的准确位置