外星人
This commit is contained in:
parent
51b31a539b
commit
bd5b7cc53c
11
alien.py
11
alien.py
|
@ -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"""
|
||||
|
Loading…
Reference in New Issue