From 39b1a897eec86f532ca1417698057ae9e1130985 Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Wed, 3 Jan 2018 14:00:59 +0100 Subject: pipi --- Penguloon/Content/Content.mgcb | 12 ++++++++++++ Penguloon/Content/Sounds/click3.wav | Bin 0 -> 94280 bytes Penguloon/Content/Sounds/placeobject.wav | Bin 0 -> 54254 bytes Penguloon/ContentPathManager.cs | 2 ++ Penguloon/Controls/LevelSelector.cs | 1 - Penguloon/Controls/ObjectSelector.cs | 2 ++ Penguloon/Levels/LevelBase.cs | 1 + Penguloon/SoundManager.cs | 28 ++++++++++++++++++++++++++++ 8 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 Penguloon/Content/Sounds/click3.wav create mode 100644 Penguloon/Content/Sounds/placeobject.wav diff --git a/Penguloon/Content/Content.mgcb b/Penguloon/Content/Content.mgcb index f3ab71e..df948a6 100644 --- a/Penguloon/Content/Content.mgcb +++ b/Penguloon/Content/Content.mgcb @@ -787,3 +787,15 @@ /processorParam:TextureFormat=Color /build:Objects/mortarBase.png +#begin Sounds/placeobject.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sounds/placeobject.wav + +#begin Sounds/click3.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sounds/click3.wav + diff --git a/Penguloon/Content/Sounds/click3.wav b/Penguloon/Content/Sounds/click3.wav new file mode 100644 index 0000000..f82e406 Binary files /dev/null and b/Penguloon/Content/Sounds/click3.wav differ diff --git a/Penguloon/Content/Sounds/placeobject.wav b/Penguloon/Content/Sounds/placeobject.wav new file mode 100644 index 0000000..a6a5412 Binary files /dev/null and b/Penguloon/Content/Sounds/placeobject.wav differ diff --git a/Penguloon/ContentPathManager.cs b/Penguloon/ContentPathManager.cs index 9a29509..78da37f 100644 --- a/Penguloon/ContentPathManager.cs +++ b/Penguloon/ContentPathManager.cs @@ -92,7 +92,9 @@ namespace Penguloon { "Sounds/click", "Sounds/click2", + "Sounds/click3", "Sounds/pop", + "Sounds/placeobject", }; public static List TexturePathsPreLoad { get; set; } = new List() diff --git a/Penguloon/Controls/LevelSelector.cs b/Penguloon/Controls/LevelSelector.cs index 64355d0..de3b080 100644 --- a/Penguloon/Controls/LevelSelector.cs +++ b/Penguloon/Controls/LevelSelector.cs @@ -80,7 +80,6 @@ namespace Penguloon.Controls { selectedMap -= 2; - SoundManager.PlayClickSound2(); return; } diff --git a/Penguloon/Controls/ObjectSelector.cs b/Penguloon/Controls/ObjectSelector.cs index 56dff8a..8a48be4 100644 --- a/Penguloon/Controls/ObjectSelector.cs +++ b/Penguloon/Controls/ObjectSelector.cs @@ -108,11 +108,13 @@ namespace Penguloon.Controls if (SelectedObjectIndex != i) { + SoundManager.PlayClickSound2(); SelectedObjectIndex = i; State = State.Selected; } else { + SoundManager.PlayClickSound2(); SelectedObjectIndex = -1; State = State.Idle; } diff --git a/Penguloon/Levels/LevelBase.cs b/Penguloon/Levels/LevelBase.cs index dc8b5af..eb34dae 100644 --- a/Penguloon/Levels/LevelBase.cs +++ b/Penguloon/Levels/LevelBase.cs @@ -149,6 +149,7 @@ namespace Penguloon.Levels Money -= ParentScene.ObjectSeletor.Objects[ParentScene.ObjectSeletor.SelectedObjectIndex].Item2; MoneySpent += ParentScene.ObjectSeletor.Objects[ParentScene.ObjectSeletor.SelectedObjectIndex].Item2; + SoundManager.PlayPlaceObjectSound(); Map.SpawnObject(ParentScene.ObjectSeletor.Objects[ParentScene.ObjectSeletor.SelectedObjectIndex].Item1.GetType(), new Vector2(posToSpawnX, posToSpawnY)); diff --git a/Penguloon/SoundManager.cs b/Penguloon/SoundManager.cs index e665197..b50e04b 100644 --- a/Penguloon/SoundManager.cs +++ b/Penguloon/SoundManager.cs @@ -7,6 +7,8 @@ namespace Penguloon public static SoundEffectInstance Baseline { get; set; } public static SoundEffectInstance BtnClick { get; set; } public static SoundEffectInstance BtnClick2 { get; set; } + public static SoundEffectInstance BtnClick3 { get; set; } + public static SoundEffectInstance PlaceObject { get; set; } public static void StartBaseline() { @@ -43,6 +45,32 @@ namespace Penguloon BtnClick2.Play(); } + public static void PlayClickSound3() + { + if (BtnClick3 == null) + { + SoundEffect effect = ContentManager.GetSound("Sounds/click3"); + BtnClick3 = effect.CreateInstance(); + BtnClick3.Volume = 1f; + BtnClick3.IsLooped = false; + } + + BtnClick3.Play(); + } + + public static void PlayPlaceObjectSound() + { + if (PlaceObject == null) + { + SoundEffect effect = ContentManager.GetSound("Sounds/placeobject"); + PlaceObject = effect.CreateInstance(); + PlaceObject.Volume = 1f; + PlaceObject.IsLooped = false; + } + + PlaceObject.Play(); + } + public static void PlayBalloonPopSound() { SoundEffect popEffect = ContentManager.GetSound("Sounds/pop"); -- cgit v1.2.3-70-g09d2