From 76b229f40b8e53b9380b5c11dbb1ba0a18d7e66c Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 10 May 2015 13:12:11 +0100 Subject: [PATCH] changed levels and generators --- assets.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/assets.py b/assets.py index 89946e9..2165d25 100644 --- a/assets.py +++ b/assets.py @@ -31,15 +31,25 @@ class Textures(): Level_Template = namedtuple('Level_Template', ("rows", "padding", "firebacks", "powerups")) Levels = [ - Level_Template(4, 30, 3, 0), - Level_Template(3, 15, 0, 1), - Level_Template(3, 20, 2, 1) + Level_Template(2, 20, 0, 0), + Level_Template(3, 15, 2, 1), + Level_Template(4, 25, 7, 1) ] + def generate_random_level(): logging.info("Generating a random level!") rows = randint(0, 12) - padding = randint(5, 75) + padding = randint(0, 30) firebacks = randint(0, 15) powerups = randint(0, 15) - return Level_Template(rows, padding, firebacks, powerups) \ No newline at end of file + return Level_Template(rows, padding, firebacks, powerups) + +Sounds = {} +def init_sounds(): + music_files = ["main.mp3", "fire.mp3"] + for file in music_files: + path = os.path.dirname(os.path.realpath(__file__)) + "\\resources\\sounds\\" + file + if file == "main.mp3": mixer = pygame.mixer.music.load(path) + else: mixer = pygame.mixer.Sound(file) + Sounds.update(file.split(".")[0], mixer)