Added gun cyclinder stop sfx

This commit is contained in:
2025-06-22 18:37:27 +01:00
parent c0727b2f02
commit 5be3d93e52

View File

@ -33,7 +33,7 @@ class Game(gameUtils.Game):
self.gunShot = pygame.mixer.Sound("./assets/gun-shot.mp3") self.gunShot = pygame.mixer.Sound("./assets/gun-shot.mp3")
self.gunSpin = pygame.mixer.Sound("./assets/gun-spin.mp3") self.gunSpin = pygame.mixer.Sound("./assets/gun-spin.mp3")
self.gunLoad = pygame.mixer.Sound("./assets/gun-load.mp3") self.gunLoad = pygame.mixer.Sound("./assets/gun-load.mp3")
self.gunCyclinder = pygame.mixer.Sound("./assets/gun-cylinder-stop.mp3") self.gunCyclinderStop = pygame.mixer.Sound("./assets/gun-cylinder-stop.mp3")
#self.gun = pygame.load_animation('./assets/gun-spin.webp') #self.gun = pygame.load_animation('./assets/gun-spin.webp')
self.gunFlash = pygame.image.load("./assets/muzzleflash.png") self.gunFlash = pygame.image.load("./assets/muzzleflash.png")
@ -86,6 +86,7 @@ class Game(gameUtils.Game):
elif event.type == gameUtils.AnimFinish: elif event.type == gameUtils.AnimFinish:
if event.objectID == self.gun.objectID and event.animationID == 'spin': if event.objectID == self.gun.objectID and event.animationID == 'spin':
self.timeout("FireDelay",randint(0,2000)/1000) self.timeout("FireDelay",randint(0,2000)/1000)
self.playSound(self.gunCyclinderStop)
elif event.type == gameUtils.Timeout: elif event.type == gameUtils.Timeout:
self.shockScale += self.fire() #check if the user gets shot self.shockScale += self.fire() #check if the user gets shot