该程序运行良好,无需尝试加载图像。 尝试打开它时,pygame窗口打开并立即消失。 (我是编程的新手)
import pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
background = pygame.image.load('togepi.png')
pygame.display.set_caption("Mugiwara")
#Game Loop
running = True
while running:
screen.fill((0, 0, 0))
screen.blit(background, (0,0))
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False][1]