页面加载中...
Pygame 是一个用于开发 2D 游戏的 Python 库。
pip install pygame
import pygame
pygame.init()
screen = pygame.display.set_mode((640, 480))
pygame.display.set_caption('Hello Pygame')
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.quit()
运行上面的代码,你会看到一个简单的窗口!