Exemple #1
0
        protected override void UpdateScreen(GameTime gameTime)
        {
            mouse.Update();

            foreach (var b in musicBlock.Buttons)
            {
                b.Value.Update(gameTime, mouse);
            }

            foreach (var b in soundBlock.Buttons)
            {
                b.Value.Update(gameTime, mouse);
            }

            if (InputMap.NewActionPress("Finished"))
            {
                ExitScreen();
                screenBefore.ActivateScreen();
            }
            if (OptionsState == TowerDefense.OptionsState.Music)
            {
                if (InputMap.NewActionPress("Volume Up") && Settings.MusicVolume < 1.0f)
                {
                    Settings.MusicVolume += 0.05f;
                    AudioManager.singleton.SetVolume("Music", Settings.MusicVolume);
                    musicBlock.GetButton("MusicButton").ButtonText.Value = String.Format("Music:{0}%", (int)(Settings.MusicVolume * 100));
                }

                if (InputMap.NewActionPress("Volume Down") && Settings.MusicVolume > 0)
                {
                    Settings.MusicVolume -= 0.05f;
                    AudioManager.singleton.SetVolume("Music", Settings.MusicVolume);
                    musicBlock.GetButton("MusicButton").ButtonText.Value = String.Format("Music:{0}%", (int)(Settings.MusicVolume * 100));
                }
            }
            else if (OptionsState == TowerDefense.OptionsState.Sound)
            {
                if (InputMap.NewActionPress("Volume Up") && Settings.SoundVolume < 1.0f)
                {
                    Settings.SoundVolume += 0.05f;
                    AudioManager.singleton.SetVolume("Sound", Settings.SoundVolume);
                    soundBlock.GetButton("SoundButton").ButtonText.Value = String.Format("Sound:{0}%", (int)(Settings.SoundVolume * 100));
                    AudioManager.singleton.PlaySound("Hit");
                }

                if (InputMap.NewActionPress("Volume Down") && Settings.SoundVolume > 0)
                {
                    Settings.SoundVolume -= 0.05f;
                    AudioManager.singleton.SetVolume("Sound", Settings.SoundVolume);
                    soundBlock.GetButton("SoundButton").ButtonText.Value = String.Format("Sound:{0}%", (int)(Settings.SoundVolume * 100));
                    AudioManager.singleton.PlaySound("Hit");
                }
            }
        }
Exemple #2
0
 protected override void UpdateScreen(GameTime gameTime)
 {
     if (InputMap.NewActionPress("Finished"))
     {
         ExitScreen();
         screenBefore.ActivateScreen();
     }
     if (InputMap.NewActionPress("Next"))
     {
         if (index >= (helpTextures.Count - 1))
         {
             index = 0;
         }
         else
         {
             index++;
         }
     }
 }
 void PauseScreenRemoving(object sender, EventArgs e)
 {
     MenuEntries.Clear();
     screenBefore.ActivateScreen();
     session.Resume();
 }