From cb82deed7bdc28af8853fcbd3d05eee4e7bac26d Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 12 May 2015 22:48:41 +0100 Subject: [PATCH] stop bug where multiple sounds play --- game.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/game.py b/game.py index 2e69ea3..a320ce5 100644 --- a/game.py +++ b/game.py @@ -80,9 +80,10 @@ def play(window, options): bullet_group.add(temp) if event.type == pygame.KEYDOWN and event.key == pygame.K_KP_PLUS: - player.OP = True - Sounds["main"].stop() - Sounds["OP"].play(loops=-1) + if not player.options["Sounds"] or not player.OP: + Sounds["main"].stop() + Sounds["OP"].play(loops=-1) + player.OP = True keys = pygame.key.get_pressed() if keys[pygame.K_RIGHT] or keys[pygame.K_d]: