Oct-12-2022, 02:00 AM
Hi Im new to pygame and Coding in general And I just started a tutorial and Whenever I try and load my png images and I run the code i shows up as an error here is my code
import pygame
import pygame
from pygame.locals import * pygame.init() screen_width = 800 screen_height = 600 screen = pygame.display.set_mode((screen_width,screen_height)) pygame.display.set_caption('Platformer') #load images bg_img = pygame.image.load("img/sky.png") run = True while run: for event in pygame.event.get(): if event.type == pygame.QUIT: run = False screen.blit(bg_img, (0,0)) pygame.display.update() pygame.quit()Whenever I try and do This It come up as an Error such as this
Error:FileNotFoundError: No file 'img/sky.png' found in working directory 'C:\Users\yeg20\OneDrive\Desktop\workspace'.
Could anyone tell me why this is happening and how to fix it?