Example #1
0
        public override void Update()
        {
            // Add your update below this line: ----------------------------

            //-----------------------------------------------------------
            // Sound Update - place here:
            //-----------------------------------------------------------

            //---------------------------------------------------------------------------------------------------------
            // Font Experiment
            //---------------------------------------------------------------------------------------------------------
            Font pTestMessage = FontMan.Find(Font.Name.TestMessage);

            Debug.Assert(pTestMessage != null);
            pTestMessage.UpdateMessage("dog " + count++);

            // walk through all objects and push to proxy
            GameObjectMan.Update();

            // Do the collision checks
            ColPairMan.Process();

            //-----------------------------------------------------------
            // Sound Experiments
            //-----------------------------------------------------------

            // Adjust music theme volume
            Sound tmpSnd = SoundMan.Find(Sound.Name.Snd_Theme);
            float vol    = tmpSnd.GetVolume();

            if (vol > 0.30f)
            {
                vol_delta = -0.002f;
            }
            else if (vol < 0.00f)
            {
                vol_delta = 0.002f;
            }
            tmpSnd.SetVolume(vol + vol_delta);

            InputMan.Update();
            // Load by file
            missileCount++;
            if (missileCount == 200)
            {
                missileCount = 0;
                // play one by file, not by load
                SoundMan.Play(Sound.Name.Snd_Shoot);
            }

            //// Trigger already loaded sounds
            //if (pMissile.y > 500.0f || pMissile.y < 100.0f)
            //{
            //    pMissile.speed *= -1.0f;

            //    switch (count%4)
            //    {
            //        case 0:
            //            SoundMan.Play(Sound.Name.Snd_HitWall);
            //            break;
            //        case 1:
            //            SoundMan.Play(Sound.Name.Snd_Explosion);
            //            break;
            //        case 2:
            //            SoundMan.Play(Sound.Name.Snd_UFO1);
            //            break;
            //        case 3:
            //            SoundMan.Play(Sound.Name.Snd_UFO2);
            //            break;
            //        default:
            //            Debug.Assert(false);
            //            break;
            //    }

            //}
            // Fire off the timer events
            TimerMan.Update(this.GetTime());

            GameObjectMan.Update();

            //Debug.WriteLine("\n------------------------------------");
            ColPairMan.Process();
        }