summaryrefslogtreecommitdiff
path: root/Penguloon/SoundManager.cs
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2017-12-11 22:02:13 +0100
committeraldrikboy <aldrikboy@gmail.com>2017-12-11 22:02:13 +0100
commitfd6fa4e5cebbe3edb65d50c78dcc8a97ce98ce64 (patch)
tree8950f6b9023e0b47e22e1cd4869ab76de0803f4c /Penguloon/SoundManager.cs
parentc4c0f3c887d627b6432551e96009c7aeecd4cdd8 (diff)
First commit
Diffstat (limited to 'Penguloon/SoundManager.cs')
-rw-r--r--Penguloon/SoundManager.cs32
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