From 92a5d7c3ff3fbdc5cfc11274dadbd5932ef561d4 Mon Sep 17 00:00:00 2001 From: TRS_MML Date: Sat, 14 Jun 2025 00:41:52 +0100 Subject: [PATCH] Fixed Multiple GunSpin sounds playing if the space bar is pressed multiple times --- __main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/__main__.py b/__main__.py index a7dc7e3..c2d76e4 100644 --- a/__main__.py +++ b/__main__.py @@ -49,11 +49,12 @@ while running: PlaySound(GunSpin) elif event.key == pygame.K_SPACE: startSpin = True - PlaySound(GunSpin) #gun code WOO if startSpin == True or spinning == True:#check if space was pressed or if the gun is already spinning spinning = True #keep the gun spinning + if spinInc == 0: + PlaySound(GunSpin) spinInc += 1 #next gun frame if spinInc == 61: #if we've reached the end spinInc = 0 #reset frame count