我试图创建一个游戏的世界地图,但是当我尝试加载的世界地图到屏幕上,在命令行中告诉我,我不能这样做。 下面是代码:
import sys
import pygame
from pygame.locals import *
pygame.init ()
Surface = pygame.display.set_mode ((1000, 775), 0, 32)
pygame.display.set_caption('World Map')
WorldMap = pygame.image.load('WorldMap.jpg')
white = (255, 255, 255)
while True:
Surface.fill (white)
Surface.blit (WorldMap, (900, 675))
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit ()
sys.exit (0)
pygame.display.update()
错误看起来是这样的----
Traceback (most recent call last)
File "C:\Users\The Folder\WorldMap.py", line 9, in <module>
WorldMap = pygame.image.load ('WorldMap.jpg')
pygame.error: Couldn't open WorldMap.jpg