I am just an average noob playing with pygame, and I was wondering what is wrong with my file directory and image loading code?
import pygame, os
file_path = 'c:/users/' + os.getlogin()
bg_img = pygame.image.load(file_path+'/Documents/PYGAME/Assets/GUI/background_image.jpg')
It comes up with a syntax issue:
Traceback (most recent call last):
File "C:\Users\SVEN\Documents\PYGAME\C crawler.py", line 15, in <module>
tePlayerNorth = pygame.image.load('north.png')
FileNotFoundError: No file 'north.png' found in working directory 'C:\Users\SVEN\Documents\PYGAME'.
The directory C:\Users\SVEN\Documents\PYGAME is where the base script is, and the following folders are where the image is located.
This is me trying to recreate my folder structure:
C:/Users/SVEN/Documents/PYGAME
SCRIPT.PY
/Assets
/Entities
/Player
North.png
South.png
East.png
West.png
This is just the important part of the file-loading script, the rest is just code for the rest of the game. I have tried using the default Python loading items using /Assets/Entities/Player/North.png, but it does not work. That is all I can think of. Thanks for your help. :) (If you need the full code, I am happy to give it to you, just ask in the comments)