外星人

This commit is contained in:
206530217 2021-06-17 11:38:15 +08:00
parent 51b31a539b
commit bd5b7cc53c
1 changed files with 10 additions and 1 deletions

View File

@ -49,4 +49,13 @@ class Alien(Sprite):
# #设置生命值
# health=100
def blitme(self):
"""在指定位置绘制外星人"""
"""在指定位置绘制外星人"""
self.screen.blit(self.image,(self.rect.x,self.rect.y))
def draw_health_bar(self):
"""显示血条"""
# 参数依次表示在screen上面绘制颜色改图案左上角的坐标长度和高度
# 灰色的空白血条
pygame.draw.rect(screen,(0,230,0),((380,100),(500,10)))
def check_edgrs(self):
"""如果外星人位于屏幕边缘就返回True"""