上传文件至 ''

This commit is contained in:
206530229 2021-06-22 13:31:27 +08:00
parent d97044e3f1
commit f8318dabd8
2 changed files with 13 additions and 0 deletions

BIN
alien.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

13
alien.py Normal file
View File

@ -0,0 +1,13 @@
import pygame
from pygame.sprite import Sprite
class Alien(Sprite): # 表示单个外星人的类
def __init__(self,ai_game): # 初始化外星人并设置其起始位置
super().__init__()
self.screen = ai_game.screen
self.settings = ai_game.settings
# 加载外星人图像并设置其rect属性
self.image = pygame.image.load('images/alien.bmp')
self.rect = self.image.get_rect()