A pong clone, but with a twist!
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

music.lua 1.6 KiB

il y a 4 ans
123456789101112131415161718192021222324252627282930313233343536373839
  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