I'm trying to create a world map for a game, but when I try to load the world map to the screen, the command line tells me I'm unable to do so. Here is the code:
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()
The error looks something like this ----
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