summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2018-01-13 16:37:23 +0100
committeraldrikboy <aldrikboy@gmail.com>2018-01-13 16:37:23 +0100
commit8a4eb6a05b95290cc1d8f26b8c285d391f37fe4e (patch)
tree27444f301d8645eeb02b0b7a22b72090bb98159f
parentd26927ed5be011c8200e31e2c6f92394c279647d (diff)
game over sound
-rw-r--r--Penguloon/Content/Content.mgcb6
-rw-r--r--Penguloon/Content/Sounds/gameover.wavbin0 -> 216736 bytes
-rw-r--r--Penguloon/ContentPathManager.cs1
-rw-r--r--Penguloon/Levels/LevelBase.cs2
-rw-r--r--Penguloon/Levels/Map.cs6
-rw-r--r--Penguloon/SoundManager.cs14
6 files changed, 24 insertions, 5 deletions
diff --git a/Penguloon/Content/Content.mgcb b/Penguloon/Content/Content.mgcb
index 7705248..1bb9d6c 100644
--- a/Penguloon/Content/Content.mgcb
+++ b/Penguloon/Content/Content.mgcb
@@ -811,3 +811,9 @@
/processorParam:TextureFormat=Color
/build:Objects/penguin3.png
+#begin Sounds/gameover.wav
+/importer:WavImporter
+/processor:SoundEffectProcessor
+/processorParam:Quality=Best
+/build:Sounds/gameover.wav
+
diff --git a/Penguloon/Content/Sounds/gameover.wav b/Penguloon/Content/Sounds/gameover.wav
new file mode 100644
index 0000000..8718ca9
--- /dev/null
+++ b/Penguloon/Content/Sounds/gameover.wav
Binary files differ
diff --git a/Penguloon/ContentPathManager.cs b/Penguloon/ContentPathManager.cs
index 1831972..f6dbfa8 100644
--- a/Penguloon/ContentPathManager.cs
+++ b/Penguloon/ContentPathManager.cs
@@ -94,6 +94,7 @@ namespace Penguloon
"Sounds/click",
"Sounds/click2",
"Sounds/click3",
+ "Sounds/gameover",
"Sounds/pop",
"Sounds/placeobject",
};
diff --git a/Penguloon/Levels/LevelBase.cs b/Penguloon/Levels/LevelBase.cs
index 013bd94..d2eb1ba 100644
--- a/Penguloon/Levels/LevelBase.cs
+++ b/Penguloon/Levels/LevelBase.cs
@@ -267,6 +267,8 @@ namespace Penguloon.Levels
public void FinishGame()
{
+ SoundManager.PlayGameOverSound();
+
Finished = true;
// upload score here or something
diff --git a/Penguloon/Levels/Map.cs b/Penguloon/Levels/Map.cs
index 7f06cd0..547c0bc 100644
--- a/Penguloon/Levels/Map.cs
+++ b/Penguloon/Levels/Map.cs
@@ -99,10 +99,6 @@ namespace Penguloon.Levels
if (tileTexture != null)
ParentScene.Main.SpriteBatch.Draw(tileTexture,
destinationRectangle: new Rectangle(x * TileWidth, y * TileHeight, TileWidth, TileHeight));
-
- //if (ParentScene.ObjectSeletor.State == Controls.State.Selected)
- // ParentScene.Main.SpriteBatch.Draw(tileTexture,
- // destinationRectangle: new Rectangle(x * TileWidth, y * TileHeight, TileWidth, TileHeight));
}
}
}
@@ -173,7 +169,7 @@ namespace Penguloon.Levels
if(Enemies.Count == 0 && WaveManager.DoneSpawning && WaveManager.RoundActive)
{
WaveManager.RoundActive = false;
- Level.Money += (WaveManager.CurrentWave * 30);
+ Level.Money += (WaveManager.CurrentWave * 15);
}
}
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");