const music1 = new Audio(require('@/assets/sound/revengeOfCats.mp3'))
const explosion = new Audio(require('@/assets/sound/explosion.mp3'))
const taunt = new Audio(require('@/assets/sound/tmauvais.mp3'))

taunt.volume = 0.2
explosion.volume = 0.2

music1.loop = true
music1.volume = 0.2

export const sound = {
  startBackgroundMusic (n) {
    switch (n) {
      case '1': music1.play(); break
    }
  },
  stopBackgroundMusic () {
    music1.pause()
  },
  explosion () {
    if (Math.floor(Math.random() * Math.floor(10)) === 0) taunt.play()
    explosion.play()
  }
}
