import os import pygame from display import Scaling DEBUG = os.getenv("DEBUG") images = {} def load_images(): if not images: with open("assets/images.lst") as image_list_file: for line in image_list_file: name, *path = line.strip().split() filename = os.path.join(*path) if DEBUG: print(f"Loading images {name = }, {filename = }") image = pygame.image.load(filename) images[name] = pygame.transform.smoothscale_by( pygame.Surface.convert_alpha(image), Scaling.factor)