环境安装 pip install pygame 开始编写 第一步:初始化并创建窗口 import pygame # 导入模块 pygame.init() # 游戏初始化 screen = pygame.display.set_mode((