From 8a4eb6a05b95290cc1d8f26b8c285d391f37fe4e Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Sat, 13 Jan 2018 16:37:23 +0100 Subject: game over sound --- Penguloon/SoundManager.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Penguloon/SoundManager.cs') diff --git a/Penguloon/SoundManager.cs b/Penguloon/SoundManager.cs index b50e04b..92ba973 100644 --- a/Penguloon/SoundManager.cs +++ b/Penguloon/SoundManager.cs @@ -9,6 +9,7 @@ namespace Penguloon public static SoundEffectInstance BtnClick2 { get; set; } public static SoundEffectInstance BtnClick3 { get; set; } public static SoundEffectInstance PlaceObject { get; set; } + public static SoundEffectInstance GameOver { get; set; } public static void StartBaseline() { @@ -71,6 +72,19 @@ namespace Penguloon PlaceObject.Play(); } + public static void PlayGameOverSound() + { + if (GameOver == null) + { + SoundEffect effect = ContentManager.GetSound("Sounds/gameover"); + GameOver = effect.CreateInstance(); + GameOver.Volume = 1f; + GameOver.IsLooped = false; + } + + GameOver.Play(); + } + public static void PlayBalloonPopSound() { SoundEffect popEffect = ContentManager.GetSound("Sounds/pop"); -- cgit v1.2.3-70-g09d2