From 8fa2eebaa164cbaa14559494ca53c25bd70a8228 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 18 Apr 2015 16:33:22 +0100 Subject: [PATCH] finalised loading textures (i think) --- textures.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/textures.py b/textures.py index 055dd59..ba7638e 100644 --- a/textures.py +++ b/textures.py @@ -1,4 +1,3 @@ -import os, pygame, glob import os, pygame, glob, logging @@ -14,12 +13,16 @@ class Textures(): def loadTexturePack(self, packName): if os.path.exists(self.path + packName): + self.images["TARGETS"] = [] + targets = glob.glob(self.path+packName+"\\target*.png") + logging.debug("Found {0} target files.".format(len(targets))) + for file in targets: fileName = file.split("\\")[-1] - if + self.images["TARGETS"].append(filename) + self.pack = packName def getTexture(self, objectName): filename = self.path + self.pack + "\\{0}.png".format(self.images[objectName.upper()]) return pygame.image.load(filename) -