I already know I am going to get verbally abused because I know it is probably a simple fix. I am new to Python and I am trying to create a simple maze game for my class project. I am going over the tutorials which are quite simple, but when it attempted to import my logo, I keep getting the error that pygame couldn't open the image. Here is the code i've got thus far (after a couple of hours of googling, even found some on stack overflow but nothing seems to work):
import pygame
import os
def main():
pygame.init()
DIR = os.path.dirname(os.path.realpath("Python Stuff"))
IMGS_DIR = os.path.join(DIR, "maze")
logo = pygame.image.load(IMGS_DIR)
pygame.display.set_icon(logo)
pygame.display.set_caption("minimal program")
screen = pygame.display.set_mode((240,180))
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if __name__ == "__main__":
main()
for the love of science, I have no idea what I am doing incorrectly. I have tried three different codes. The current os code i have implemented is supposed to be the direct path, but I am still getting the "Could not open ..../maze" error. The files are in the right spot, no spelling errors, the image is a PNG file, I have no idea what's going on. PLS HELP. I should be able to complete most, if not all, of the project today, as the character implementation is going to be the most difficult for this simple project.