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)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user