Example #1
0
        public BugHunt(BaseGame game, IGState previous, Color c)
            : base(game, previous)
        {
            DragFrom = Vector2.Zero;
            Game.BackGroundTune.SetVolume(0f);
            Splats = new List <Splatter>();
            if (Message == "Get That Bug")
            {
                Wait = new Tween(new TimeSpan(0, 0, 0, 1), 0, 1);
            }
            else
            {
                Wait = new Tween(new TimeSpan(0, 0, 0, 5), 0, 1);
            }
            State = 0;
            Game.Audio.Say(Message);
            Message            = "Get That Bug";
            game.ParticleColor = (c == Color.Black) ? Color.White : Color.Black;
            Color        = c;
            LastLocation = new Vector2(-10, -10);
            voice1       = new SynthVoice(Game.Audio, AudioChannels.Synth);
            instrument   = new SynthInstrument();
            //instrument.Oscillators.Add(new SquareOscillator());
            instrument.Oscillators.Add(new SawtoothOscillator());
            instrument.Frequency = 220; // frequence de base
            voice1.LoadInstrument(instrument);
            Difficulty = 200f;
            enemy      = (Game.UnifiedInput.Location == Vector2.Zero)?enemy:Game.UnifiedInput.Location;

            steeringBehaviour = SB.Flee;
            SBs  = steeringBehaviour;
            cars = new Vehicle[1];
            InitializeCars();
        }
Example #2
0
 public Pong(BaseGame game, IGState previous, Color c)
     : base(game, previous)
 {
     DragFrom = Vector2.Zero;
     Game.BackGroundTune.SetVolume(0f);
     if (Message == "Listen to the ball")
     {
         Wait = new Tween(new TimeSpan(0, 0, 0, 1, 500), 0, 1);
     }
     else
     {
         Wait = new Tween(new TimeSpan(0, 0, 0, 7), 0, 1);
     }
     State = 0;
     Game.Audio.Say(Message);
     Message            = "Listen to the ball";
     game.ParticleColor = (c == Color.Black) ? Color.White : Color.Black;
     Color      = c;
     voice1     = new SynthVoice(Game.Audio, AudioChannels.Synth);
     instrument = new SynthInstrument();
     instrument.Oscillators.Add(new SineOscillator());
     instrument.Frequency = 220;
     voice1.LoadInstrument(instrument);
     Restart();
 }
Example #3
0
        public Task TestSound()
        {
            return(Task.Run(() =>
            {
                voice1 = new SynthVoice(Game.Audio, AudioChannels.Synth);
                //voice2 = new SynthVoice(Game.Audio,AudioChannels.Synth);
                //voice3 = new SynthVoice(Game.Audio, AudioChannels.Synth);

                SynthInstrument instrument = new SynthInstrument();
                instrument.Oscillators.Add(new SineOscillator());
                instrument.Oscillators.Add(new SquareOscillator());
                instrument.Frequency = 440f;//440f; // frequence de base
                voice1.LoadInstrument(instrument);
                //voice2.LoadInstrument(instrument);
                //voice3.LoadInstrument(instrument);
                voice1.PlaySound(140); //do
                //voice2.PlaySound(164.81f);//mi
                //voice2.PlaySound(196f);
            }));
        }