加入收藏 | 设为首页 | 会员中心 | 我要投稿 甘南站长网 (https://www.0941zz.com/)- 科技、行业物联网、开发、云计算、云管理!
当前位置: 首页 > 编程开发 > Python > 正文

python--飞机大战

发布时间:2023-02-16 14:09:11 所属栏目:Python 来源:互联网
导读:实现功能: 1:飞机的移动,发射子弹,手雷,生命值,生命条 2:敌飞机有3种形态(小,中,大)不同的飞机大小不一样,生命值不一样,爆炸动画也不一样 3:背景音乐,子弹击中敌机会发生碰撞的爆炸动画和音效 4:随机产生补给(双射子弹和全屏炸弹) 5:难度

              if pygame.mouse.get_pressed()[0]:
                  # 获取鼠标坐标
                  pos = pygame.mouse.get_pos()
                  if again_rect.left < pos[0] < again_rect.right and again_rect.top < pos[1] < again_rect.bottom:
                      main()
                  elif gameover_rect.left < pos[0] < gameover_rect.right and gameover_rect.top < pos[1] < gameover_rect.bottom:
                      pygame.quit()
                      sys.exit()
          screen.blit(paused_image,paused_rect)
          if not(delay % 11):
              switch_plane = not switch_plane
          delay -= 1
          if not delay:
              delay = 100
          pygame.display.flip()
          clock.tick(60)
  if __name__ == '__main__':
      main()
  
  部分运行截图:
 
 
 
 
 
 
  
  
 
 

(编辑:甘南站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

推荐文章
    热点阅读