From 3aa2bf1131dd60c1f08f293504babaf0501a348b Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Wed, 19 Jul 2023 15:41:22 +0200 Subject: [PATCH] Added script that loads images. --- screensaver.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/screensaver.py b/screensaver.py index 3bbc116..ab061fd 100644 --- a/screensaver.py +++ b/screensaver.py @@ -12,10 +12,14 @@ pygame.display.set_caption("Screensaver") gray = (20, 20, 20) red = (255, 20, 20) -working_directory = os.path.abspath(__file__) +working_directory = os.path.dirname(os.path.realpath(__file__)) +file_path = os.path.abspath(__file__) wobblers = [] max_wobbler_size = 50 +images = [] +for image in os.listdir(f"{working_directory}/textures"): + images.append(pygame.image.load(f"{working_directory}/textures/{image}")) clock = pygame.time.Clock() running = True