diff options
Diffstat (limited to 'Penguloon/SoundManager.cs')
| -rw-r--r-- | Penguloon/SoundManager.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Penguloon/SoundManager.cs b/Penguloon/SoundManager.cs new file mode 100644 index 0000000..4ee40c8 --- /dev/null +++ b/Penguloon/SoundManager.cs @@ -0,0 +1,32 @@ +using Microsoft.Xna.Framework.Audio; + +namespace Penguloon +{ + public static class SoundManager + { + public static SoundEffectInstance Baseline { get; set; } + public static SoundEffectInstance BtnClick { get; set; } + + public static void StartBaseline() + { + SoundEffect effect = ContentManager.GetSound("Sounds/baseline"); + Baseline = effect.CreateInstance(); + Baseline.Volume = 0.1f; + Baseline.IsLooped = true; + Baseline.Play(); + } + + public static void PlayClickSound() + { + if(BtnClick == null) + { + SoundEffect effect = ContentManager.GetSound("Sounds/click"); + BtnClick = effect.CreateInstance(); + BtnClick.Volume = 0.5f; + BtnClick.IsLooped = false; + } + + BtnClick.Play(); + } + } +}
\ No newline at end of file |
