diff --git a/assets.py b/assets.py index bc9a68a..16e97c9 100644 --- a/assets.py +++ b/assets.py @@ -25,6 +25,7 @@ class Textures(): self.images["TARGETS"].append(filename) self.pack = packName + else: logging.warn("Cannot find texture pack '{}'".format(packName)) def get_texture(self, objectName): filename = self.path + self.pack + "\\{0}.png".format(self.images[objectName.upper()]) @@ -34,6 +35,10 @@ class Textures(): filename = self.path + self.pack + "\\{}.png".format(self.images["TARGETS"][randint(0,len(self.images["TARGETS"]))]) return pygame.image.load(filename) + def list_packs(self): + return [x[0] for x in os.walk(self.path)] + + Level_Template = namedtuple('Level_Template', ("rows", "padding", "firebacks", "powerups")) Levels = [ @@ -51,6 +56,7 @@ def generate_random_level(): powerups = randint(0, 15) return Level_Template(rows, padding, firebacks, powerups) + Sounds = {} def init_sounds(): music_files = ["main.mp3", "fire.mp3"]