存储项目的大部分函数
This commit is contained in:
parent
ddf6acbfc0
commit
dd068ae818
|
@ -87,4 +87,18 @@ def update_screen(ai_settings, screen, stats, sb, ship, aliens, bossalien, bulle
|
|||
play_button.draw_button()
|
||||
|
||||
# 让最近绘制的屏幕可见
|
||||
pygame.display.flip()
|
||||
pygame.display.flip()
|
||||
def update_bullets(ai_settings, screen, stats, sb, ship, aliens, bullets, bossalien, bossbullet):
|
||||
"""更新子弹的位置,并删除已消失的子弹"""
|
||||
# 更新子弹的位置
|
||||
bullets.update()
|
||||
|
||||
if stats.level == stats.bosslevel:
|
||||
bossbullet.update()
|
||||
|
||||
# 删除已消失的子弹
|
||||
for bullet in bullets.copy():
|
||||
if bullet.rect.bottom <= 0:
|
||||
bullets.remove(bullet)
|
||||
|
||||
check_bullet_collisions(ai_settings, screen, stats, sb, ship, aliens, bossalien, bullets, bossbullet)
|
Loading…
Reference in New Issue