diff --git a/Shared/Player.cs b/Shared/Player.cs index 0494ff2..78483f2 100644 --- a/Shared/Player.cs +++ b/Shared/Player.cs @@ -222,6 +222,7 @@ namespace SemiColinGames { if (input[0].Attack && !input[1].Attack && swordSwingTime <= 0) { swordSwingTime = 0.3; swordSwingNum = (swordSwingNum + 1) % swordSwingMax; + SoundEffects.SwordSwings[swordSwingNum % SoundEffects.SwordSwings.Length].Play(); } result.Y = ySpeed * modelTime; diff --git a/Shared/Shared.projitems b/Shared/Shared.projitems index 0e40fc4..7e3ef15 100644 --- a/Shared/Shared.projitems +++ b/Shared/Shared.projitems @@ -11,6 +11,7 @@ + diff --git a/Shared/SneakGame.cs b/Shared/SneakGame.cs index cb3c62b..192f921 100644 --- a/Shared/SneakGame.cs +++ b/Shared/SneakGame.cs @@ -64,6 +64,7 @@ namespace SemiColinGames { // Called once per game. Loads all game content. protected override void LoadContent() { base.LoadContent(); + SoundEffects.Load(Content); Textures.Load(Content); linesOfSight = new LinesOfSight(GraphicsDevice); LoadLevel(); diff --git a/Shared/SoundEffects.cs b/Shared/SoundEffects.cs new file mode 100644 index 0000000..6881434 --- /dev/null +++ b/Shared/SoundEffects.cs @@ -0,0 +1,16 @@ +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Content; + +namespace SemiColinGames { + public static class SoundEffects { + + public static SoundEffect[] SwordSwings = new SoundEffect[4]; + + public static void Load(ContentManager content) { + SwordSwings[0] = content.Load("sfx/zapsplat/sword_whoosh_1"); + SwordSwings[1] = content.Load("sfx/zapsplat/sword_whoosh_2"); + SwordSwings[2] = content.Load("sfx/zapsplat/sword_whoosh_3"); + SwordSwings[3] = content.Load("sfx/zapsplat/sword_whoosh_4"); + } + } +}