Why does it says that couldn't open shooting_game\player.png on Pygame? Here's my code so far:
import pygame
import os
width, height = 500, 400
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("Shooter Game")
player = pygame.image.load(os.path.join("shooter_game", "player.png"))
This gives me a error:
Exception has occurred: error
Couldn't open shooter_game/player.png
File "C:\python_games\shooter_game\game.py", line 11, in <module>
player = pygame.image.load(os.path.join("shooter_game", "player.png"))
I maked sure that player.png
's folder was
in the same folder as game.py
's folder.
Can someone help me figure out this problem?
Thanks.