A pong clone, but with a twist!
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.

music.lua 2.0 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. function musicController(orders, toggling)
  2. if (orders == 'norm' and not mute) then
  3. if (globalState == 'menu') then
  4. sounds['gayTheme']:stop()
  5. sounds['gayTheme2']:stop()
  6. sounds['gayTheme3']:stop()
  7. sounds['updateMusic']:play()
  8. elseif (areanuclear == 1) then
  9. sounds['gayTheme']:setVolume(0)
  10. sounds['gayTheme2']:setVolume(0)
  11. elseif ((gameState == 'play' or gameState == '1serve' or gameState == '2serve') and player1score <= 7 and player2score <= 7 and areanuclear == 0) then
  12. sounds['updateMusic']:stop()
  13. sounds['gayTheme2']:stop()
  14. sounds['gayTheme3']:stop()
  15. sounds['gayTheme']:setPitch(1)
  16. sounds['gayTheme']:setLooping(true)
  17. sounds['gayTheme']:setVolume(0.5)
  18. sounds['gayTheme']:play()
  19. elseif gameState == 'play' and player1score > ptw-2 or player2score > ptw-2 and areanuclear == 0 then
  20. --print(ptw-2)
  21. sounds['gayTheme']:stop()
  22. sounds['gayTheme3']:stop()
  23. sounds['updateMusic']:stop()
  24. sounds['gayTheme2']:setPitch(1)
  25. sounds['gayTheme2']:setLooping(true)
  26. sounds['gayTheme2']:setVolume(0.5)
  27. sounds['gayTheme2']:play()
  28. elseif gameState == 'play' and player1score > ptw-5 or player2score > ptw-5 and areanuclear == 0 then
  29. --print(ptw-4)
  30. sounds['gayTheme']:stop()
  31. sounds['gayTheme2']:stop()
  32. sounds['updateMusic']:stop()
  33. sounds['gayTheme3']:setPitch(1)
  34. sounds['gayTheme3']:setLooping(true)
  35. sounds['gayTheme3']:setVolume(0.5)
  36. sounds['gayTheme3']:play()
  37. end
  38. elseif orders == "mute" then
  39. if toggling == 1 then
  40. sounds['gayTheme']:stop()
  41. sounds['gayTheme3']:stop()
  42. sounds['gayTheme2']:stop()
  43. sounds['updateMusic']:stop()
  44. mute = true
  45. else
  46. mute = false
  47. end
  48. end
  49. end