diff --git a/assets/surrounded.ogg b/assets/surrounded.ogg new file mode 100644 index 0000000..2003096 Binary files /dev/null and b/assets/surrounded.ogg differ diff --git a/assets/twiceoritsluck.ogg b/assets/twiceoritsluck.ogg new file mode 100644 index 0000000..1d7fa92 Binary files /dev/null and b/assets/twiceoritsluck.ogg differ diff --git a/game.py b/game.py index e93becf..5f4f750 100644 --- a/game.py +++ b/game.py @@ -40,7 +40,12 @@ class Game(gameUtils.Game): self.gunSpin = pygame.mixer.Sound("./assets/gun-spin.mp3") self.gunLoad = pygame.mixer.Sound("./assets/gun-load.mp3") self.gunCyclinderStop = pygame.mixer.Sound("./assets/gun-cylinder-stop.mp3") - + + #Background Music commands + self.unloadMusic = pygame.mixer.music.unload + self.stopMusic = pygame.mixer.music.stop + self.playMusic = pygame.mixer.music.play + #self.gun = pygame.load_animation('./assets/gun-spin.webp') self.gunFlash = pygame.image.load("./assets/muzzleflash.png") @@ -63,6 +68,19 @@ class Game(gameUtils.Game): self.gunScale = min(self.size[1]/self.gunh,self.size[0]/self.gunw) #calculates how to scale the gun so that it stays on the screen + + #Selects random music to play at the start of the game, might change because I just threw this together. + #I feel horrible writing this code this feels super unoptimised :c + if self.musicNumber == 1: + pygame.mixer.music.load("./assets/surrounded.ogg") + self.playMusic(-1) + pygame.mixer.music.set_volume(0.5) + if self.musicNumber == 2: + pygame.mixer.music.load("./assets/twiceoritsluck.ogg") + self.playMusic(-1) + pygame.mixer.music.set_volume(0.5) + + def fire(self):#LETS GO GAMBLING if randint(1,6) == 6: self.playSound(self.gunShot)