Browse Source

add short music loop to demo stage

GitOrigin-RevId: 7ea3d773b1
master
Colin McMillen 4 years ago
parent
commit
29cf5eb0c9
  1. 5
      Shared/SneakGame.cs
  2. 2
      Shared/SoundEffects.cs

5
Shared/SneakGame.cs

@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using MonoGame.Framework.Utilities;
@ -67,6 +68,10 @@ namespace SemiColinGames {
SoundEffects.Load(Content);
Textures.Load(Content);
linesOfSight = new LinesOfSight(GraphicsDevice);
SoundEffectInstance music = SoundEffects.IntroMusic.CreateInstance();
music.IsLooped = true;
music.Volume = 0.1f;
music.Play();
LoadLevel();
}

2
Shared/SoundEffects.cs

@ -4,9 +4,11 @@ using Microsoft.Xna.Framework.Content;
namespace SemiColinGames {
public static class SoundEffects {
public static SoundEffect IntroMusic;
public static SoundEffect[] SwordSwings = new SoundEffect[4];
public static void Load(ContentManager content) {
IntroMusic = content.Load<SoundEffect>("music/playonloop/smash_bros_short");
SwordSwings[0] = content.Load<SoundEffect>("sfx/zapsplat/sword_whoosh_1");
SwordSwings[1] = content.Load<SoundEffect>("sfx/zapsplat/sword_whoosh_2");
SwordSwings[2] = content.Load<SoundEffect>("sfx/zapsplat/sword_whoosh_3");

Loading…
Cancel
Save