A stealth-based 2D platformer where you don't have to kill anyone unless you want to. https://www.semicolin.games
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

44 lines
749 B

using Microsoft.Xna.Framework.Audio;
using System;
namespace SemiColinGames {
public class MusicPlayer : IDisposable {
public static bool Enabled = false;
private SoundEffectInstance music;
~MusicPlayer() {
Dispose();
}
public void Dispose() {
Stop();
music?.Dispose();
GC.SuppressFinalize(this);
}
public void Load(SoundEffect sound) {
if (sound == null) {
return;
}
music = sound.CreateInstance();
music.IsLooped = true;
music.Volume = 0.1f;
}
public void Stop() {
music?.Stop();
}
public void Pause() {
music?.Pause();
}
public void Play() {
if (Enabled) {
music?.Play();
}
}
}
}