When i try to load a image with pygame it is like the .load part in pygame.image.load does not exist. I have Initialized it so i dont know why it wont let me use the images.
Code:
# Imports
import os
import time
import random
import pygame
from pygame.locals import *
# Init
pygame.init()
# Loading images
RED_SPACE_SHIP = pygame.image.load(os.path.join("assets", "pixel_ship_red_small.png"))
GREEN_SPACE_SHIP = pygame.image.load(os.path.join("assets", "pixel_ship_green_small.png"))
BLUE_SPACE_SHIP = pygame.image.load(os.path.join("assets", "pixel_ship_blue_small.png"))
# Player's Ship
YELLOW_SPACE_SHIP = pygame.image.load(os.path.join("assets", "pixel_ship_yellow.png"))
# Lasers
RED_LASER = pygame.image.load(os.path.join("assets", "pixel_laser_red.png"))
RED_GREEN = pygame.image.load(os.path.join("assets", "pixel_laser_green.png"))
RED_BLUE = pygame.image.load(os.path.join("assets", "pixel_laser_blue.png"))
RED_YELLOW = pygame.image.load(os.path.join("assets", "pixel_laser_yellow.png"))
# Background
BG = pygame.image.load(os.path.join("assets", "background-black.png"))
Error: File "c:/Users/(user)/Desktop/Python Projects/SpaceInvader/main.py", line 12, in RED_SPACE_SHIP = pygame.image.load(os.path.join("assets", "pixel_ship_red_small.png")) pygame.error: Couldn't open assets\pixel_ship_red_small.png
It isnt just the red ship when i removed that line its all of them.