A pong clone, but with a twist!
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

music.lua 2.0 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. function musicController(orders, toggling)
  2. if (orders == 'norm') 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 ~= nil then
  39. sounds[orders]:setPitch(1)
  40. sounds[orders]:setLooping(true)
  41. sounds[orders]:setVolume(0.9)
  42. sounds[orders]:play()
  43. if (toggling == 1) then
  44. sounds[orders]:setVolume(0.9)
  45. else
  46. sounds[orders]:stop()
  47. end
  48. end
  49. end