Im trying to load an image into a window on pygame but when i run the code. It pops up with an error of
pygame.error: Couldn't open backround.png
I have the image in the same folder with the code itself. I have done this for another script and it works perfectly fine. I am not sure what the problem is.
I've tried closing my program. Renaming the file but that's about it. Not sure how to tackle the problem. Any help is much appreciated
import pygame
import os
from Introduction import *
# Making the window
pygame.init()
windowSize = (800, 600)
screen = pygame.display.set_mode(windowSize)
# Images in the Introduction
GameBackround = pygame.image.load('backround.png')
while True:
screen.blit(GameBackround, (0,0))
for event in pygame.event.get():
screen.blit(GameBackround, (0,0))
pygame.display.update()
pygame.display.flip()
Like I said: I have used similar layout to load images with another file and it works perfectly fine but for some reason it doesn't load the image in case.