Exemplo n.º 1
0
        /* Play all buffered sounds calls, then clear the buffer */
        public void play()
        {
            foreach (var key in sounds.Keys)
            {
                SoundManager.playSound(key, sounds[key]);
            }

            sounds.Clear();
            groups.Clear();

            foreach (var key in delays.Keys)
            {
                if (delays.ContainsKey(key))
                {
                    delays[key]--;
                }
                else
                {
                    add(key);
                    delays.Remove(key);
                }
            }
        }
Exemplo n.º 2
0
 public void selectSound()
 {
     SoundManager.playSound("chirup");
 }
Exemplo n.º 3
0
        /* Play a random sound immediately instead of waiting for the update */
        public void playRandom(Array <string> choices, double volume = 1.0)
        {
            var key = choices[(int)((Math.random() * choices.length)) >> 0];

            SoundManager.playSound(key, volume);
        }