Skip to content
Snippets Groups Projects
Commit c08a74f9 authored by Jantz's avatar Jantz
Browse files

round winning sound added

parent f67e3f1d
No related branches found
No related tags found
No related merge requests found
File added
......@@ -18,6 +18,7 @@ import pygame as pg
import time
from world import World
from gui import GUI
import sound
def main():
# World object creation
......@@ -85,8 +86,10 @@ def main():
world.turret_attacks(dt)
# If spawn list is empty and no enemies left, end the round
if len(world.round_spawn_times) == 0 and len(world.enemies) == 0:
if world.round_active and len(world.round_spawn_times) == 0 and len(world.enemies) == 0:
world.round_active = False
sound.round_win.play()
if world.request_to_start_round:
world.current_round += 1
......
......@@ -6,6 +6,7 @@ coin_sound = pg.mixer.Sound('assets/sounds/coins.wav')
bullet_sound = pg.mixer.Sound('assets/sounds/bullet.mp3')
zombie_groan_1 = pg.mixer.Sound('assets/sounds/zombie_groan_1.mp3')
zombie_groan_2 = pg.mixer.Sound('assets/sounds/zombie_groan_2.mp3')
round_win = pg.mixer.Sound('assets/sounds/round_win.mp3')
# Set the volume of the sounds
......@@ -13,6 +14,7 @@ coin_sound.set_volume(0.6)
bullet_sound.set_volume(0.2)
zombie_groan_1.set_volume(0.2)
zombie_groan_2.set_volume(0.2)
round_win.set_volume(0.6)
def play_zombie_groan():
"""Plays a random zombie groan sound."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment