From 8f65ce87e23a8ac5e98d1aedb4942fb647f59e57 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Mon, 6 Apr 2020 12:31:44 +0200 Subject: [PATCH] Entities load using abs path --- src/entities/Entity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entities/Entity.py b/src/entities/Entity.py index fee6d5f..73c7071 100644 --- a/src/entities/Entity.py +++ b/src/entities/Entity.py @@ -24,12 +24,12 @@ class Entity(pygame.sprite.Sprite): texturesFolder = "" textureFile = "" try: - texturesFolder = Path("../data/images/entities") + texturesFolder = Path("./data/images/entities") textureFile = texturesFolder / textureName except IOError: print("Cannot load texture from " + texturesFolder + ". Exiting...") exit(1) - image = pygame.image.load(str(textureFile)).convert_alpha() + image = pygame.image.load(str(textureFile.resolve())).convert_alpha() image = pygame.transform.scale(image, (tileSize, tileSize)) rect = image.get_rect() return image, rect