2026-10-02 16:28:01 +00:00
|
|
|
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-10-02 16:28:01 +00:00
|
|
|
|
|
|
|
|
|
2026-11-11 17:32:27 +00:00
|
|
|
def load_image(path: str | Path) -> pygame.Surface:
|
2026-10-02 16:28:01 +00:00
|
|
|
# print(self.images_path)
|
|
|
|
|
# print(self.images_path / path)
|
|
|
|
|
return pygame.image.load(images_path / path)
|