school-horror-game/scripts/utils.py

13 lines
388 B
Python
Raw Permalink Normal View History

from pathlib import Path
import pygame
# Einheitlichkeit: Wenn image_path ein Path-Objekt ist, sollte auch load_image ein Path-Objekt laden.
2026-11-11 17:32:27 +00:00
images_path = Path(__file__).resolve().parent.parent / "data" / "textures"
2026-11-11 17:32:27 +00:00
def load_image(path: str | Path) -> pygame.Surface:
# print(self.images_path)
# print(self.images_path / path)
return pygame.image.load(images_path / path)