You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.6 KiB

  1. function musicController(orders, toggling)
  2. if (orders == 'norm') then
  3. if (gameState ~= 'play' and gameState ~= '1serve' and gameState ~= '2serve' and areanuclear == 0) then
  4. sounds['gayTheme']:stop()
  5. sounds['gayTheme2']:stop()
  6. sounds['updateMusic']:play()
  7. elseif (areanuclear == 1) then
  8. sounds['gayTheme']:setVolume(0)
  9. sounds['gayTheme2']:setVolume(0)
  10. elseif ((gameState == 'play' or gameState == '1serve' or gameState == '2serve') and player1score <= 7 and player2score <= 7 and areanuclear == 0) then
  11. sounds['updateMusic']:stop()
  12. sounds['gayTheme']:setPitch(1)
  13. sounds['gayTheme']:setLooping(true)
  14. sounds['gayTheme']:setVolume(0.5)
  15. sounds['gayTheme']:play()
  16. elseif gameState == 'play' and player1score > 7 or player2score > 7 and areanuclear == 0 then
  17. sounds['gayTheme']:stop()
  18. sounds['updateMusic']:stop()
  19. sounds['gayTheme2']:setPitch(1)
  20. sounds['gayTheme2']:setLooping(true)
  21. sounds['gayTheme2']:setVolume(0.5)
  22. sounds['gayTheme2']:play()
  23. else
  24. end
  25. elseif order ~= nil then
  26. sounds[orders]:setPitch(1)
  27. sounds[orders]:setLooping(true)
  28. sounds[orders]:setVolume(0.9)
  29. sounds[orders]:play()
  30. if (toggling == 1) then
  31. sounds[orders]:setVolume(0.9)
  32. else
  33. sounds[orders]:setVolume(0)
  34. end
  35. end
  36. end