Allow more fine controls for main sound track
This commit is contained in:
parent
f8e2e5df71
commit
1b44b11144
2 changed files with 7 additions and 2 deletions
|
@ -67,6 +67,9 @@ def init_sounds():
|
|||
music_files = ["main.wav", "OP.wav", "shot.wav"]
|
||||
for file in music_files:
|
||||
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)
|
||||
Sounds[file.replace(".wav", "")] = mixer
|
4
game.py
4
game.py
|
@ -154,11 +154,13 @@ def play(window, options):
|
|||
|
||||
if len(target_group) == 0: #If all current players are gone.
|
||||
player.level += 1
|
||||
Sounds["main"].set_volume(0.5)
|
||||
target_group = generate_targets(player, WINDOW_SIZE, Levels)
|
||||
target_group.draw(window)
|
||||
bullet_group.empty()
|
||||
pygame.display.update()
|
||||
sleep(1.5)
|
||||
sleep(0.75)
|
||||
Sounds["main"].set_volume(1.0)
|
||||
|
||||
if player.OP:
|
||||
player.change_colour((255,96,0)) #override colour change if changed before
|
||||
|
|
Reference in a new issue