using System; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; namespace BouncyCatIsBouncy { class RandomCatSounds : ILoadableContent { SoundEffect[] m_soundEffects; Random m_rand = new Random(); public RandomCatSounds() { } public RandomCatSounds(ContentManager content) { LoadContent(content); } public void Play() { if (m_soundEffects != null) { m_soundEffects[m_rand.Next(m_soundEffects.Length)].Play(.45f, 0.0f, 0.0f); } } //Hard coding sucks, being short on time sucks even more public void LoadContent(ContentManager manager) { m_soundEffects = new SoundEffect[] { manager.Load(@"Sounds/Cat/angrymeow"), manager.Load(@"Sounds/Cat/cry"), manager.Load(@"Sounds/Cat/growl"), manager.Load(@"Sounds/Cat/meow"), manager.Load(@"Sounds/Cat/meow2"), }; } } }