Commit 5ff6de4b authored by Jake Howard's avatar Jake Howard
Browse files

added function to get packs

parent ed548bdc
......@@ -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"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment