Fixed Multiple GunSpin sounds playing if the space bar is pressed multiple times
This commit is contained in:
@ -49,11 +49,12 @@ while running:
|
|||||||
PlaySound(GunSpin)
|
PlaySound(GunSpin)
|
||||||
elif event.key == pygame.K_SPACE:
|
elif event.key == pygame.K_SPACE:
|
||||||
startSpin = True
|
startSpin = True
|
||||||
PlaySound(GunSpin)
|
|
||||||
|
|
||||||
#gun code WOO
|
#gun code WOO
|
||||||
if startSpin == True or spinning == True:#check if space was pressed or if the gun is already spinning
|
if startSpin == True or spinning == True:#check if space was pressed or if the gun is already spinning
|
||||||
spinning = True #keep the gun spinning
|
spinning = True #keep the gun spinning
|
||||||
|
if spinInc == 0:
|
||||||
|
PlaySound(GunSpin)
|
||||||
spinInc += 1 #next gun frame
|
spinInc += 1 #next gun frame
|
||||||
if spinInc == 61: #if we've reached the end
|
if spinInc == 61: #if we've reached the end
|
||||||
spinInc = 0 #reset frame count
|
spinInc = 0 #reset frame count
|
||||||
|
|||||||
Reference in New Issue
Block a user