0

Now that I know how to insert images into Pygame, I've been wondering, why is the code of inserting images into Pygame in the videos JUST WRONG?

What I mean is this:

This is the correct way of inserting images into Pygame:

PLAYER = pygame.image.load("player.png")

And this is how people do it in the videos:

PLAYER = pygame.image.load('assets/player.png')

There is an error using this method: even if you have the folder in the same folder as the folder that stores your Python project, it still gives an error saying: "FileNotFoundError: No such file or directory." If I use the correct method, as long as it's in the same folder as your Python project (even if the asset is in another folder that's inside the same folder as your Python project), it works. Why is it that tutorials on the internet use the wrong method of importing images to their projects, and act as if it works?

0 Answers0