Commit 1b44b111 authored by Jake Howard's avatar Jake Howard
Browse files

Allow more fine controls for main sound track

parent f8e2e5df
...@@ -67,6 +67,9 @@ def init_sounds(): ...@@ -67,6 +67,9 @@ def init_sounds():
music_files = ["main.wav", "OP.wav", "shot.wav"] music_files = ["main.wav", "OP.wav", "shot.wav"]
for file in music_files: for file in music_files:
path = os.path.dirname(os.path.realpath(__file__)) + "\\resources\\sounds\\" + file path = os.path.dirname(os.path.realpath(__file__)) + "\\resources\\sounds\\" + file
mixer = pygame.mixer.Sound(path) if file == "main.wav":
mixer = pygame.mixer.music
mixer.load(path)
else: mixer = pygame.mixer.Sound(path)
mixer.set_volume(1.0) mixer.set_volume(1.0)
Sounds[file.replace(".wav", "")] = mixer Sounds[file.replace(".wav", "")] = mixer
\ No newline at end of file
...@@ -154,11 +154,13 @@ def play(window, options): ...@@ -154,11 +154,13 @@ def play(window, options):
if len(target_group) == 0: #If all current players are gone. if len(target_group) == 0: #If all current players are gone.
player.level += 1 player.level += 1
Sounds["main"].set_volume(0.5)
target_group = generate_targets(player, WINDOW_SIZE, Levels) target_group = generate_targets(player, WINDOW_SIZE, Levels)
target_group.draw(window) target_group.draw(window)
bullet_group.empty() bullet_group.empty()
pygame.display.update() pygame.display.update()
sleep(1.5) sleep(0.75)
Sounds["main"].set_volume(1.0)
if player.OP: if player.OP:
player.change_colour((255,96,0)) #override colour change if changed before player.change_colour((255,96,0)) #override colour change if changed before
......
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