예제 #1
0
        public void Update()
        {
            _menu.Update();
            if (_menu.GetSelectedItem("Back"))
            {
                //take this menu off the stack
                _menuStack.Pop();

                // return the new stack to main
                _systemMain.SetStack(_menuStack);
            }
            else if (_menu.GetSelectedItem("DeathSquid"))
            {
                Game = "DeathSquid";
                //take this menu off the stack
                _menuStack.Pop();

                // return the new stack to main
                _systemMain.SetStack(_menuStack);
            }
            else if (_menu.GetSelectedItem("Breakout"))
            {
                Game = "Breakout";
                //take this menu off the stack
                _menuStack.Pop();

                // return the new stack to main
                _systemMain.SetStack(_menuStack);
            }
        }
예제 #2
0
        /// <summary>
        /// Update
        ///
        /// This method is called in our system mains update which is called extremely frequently. This method is responsible for checking
        /// the keyboard keyState and performing the appropriate actions when keys are pressed and released.
        /// </summary>
        /// <param name="handler">the key and button handler</param>
        public void Update()
        {
            _menu.Update();

            if (_menu.GetSelectedItem("Take Quiz"))
            {
                _menuStack.Push(new SystemDisplay(_menuStack, _systemMain));
                _systemMain.SetStack(_menuStack);
            }
            if (_menu.GetSelectedItem("Options"))
            {
                // create an options menu than push it onto the _menuStack
                _menuStack.Push(new OptionsMenu(_menuStack, _systemMain));
                // return the new _menuStack to main
                _systemMain.SetStack(_menuStack);
            }
            if (_menu.GetSelectedItem("View Scores"))
            {
                // create a scores menu and add it to the stack
                _menuStack.Push(new ScoresMenu(_menuStack, _systemMain));
                //return the new stack to main
                _systemMain.SetStack(_menuStack);
            }
            if (_menu.GetSelectedItem("Exit"))
            {
                _systemMain.Close();
            }
        }
예제 #3
0
        public void Update()
        {
            foreach (var sound in SystemMain.SoundsBackgroundInstance)
            {
                if (sound.State == SoundState.Playing)
                {
                    sound.Stop();
                }
            }
            if (SystemMain.SoundQuizBgInstance.State != SoundState.Playing)
            {
                if (!SystemMain.SoundQuizBgInstance.IsLooped)
                {
                    SystemMain.SoundQuizBgInstance.IsLooped = true;
                }

                SystemMain.SoundQuizBgInstance.Volume = .4f;
                SystemMain.SoundQuizBgInstance.Play();
            }
            _menu.Update();

            // Answer the question with the current selection obtained from _menu
            //if(SystemMain.GetInput.IsButtonPressed(ButtonAction.MenuAccept))
            //{
            if (_menu.GetSelectedItem(false) != "")
            {
                AnswerTheQuestion(_currentQuestion.GetAnswer(_menu.GetSelectedItem(true)));
            }

            //}
        }
예제 #4
0
 public void Update()
 {
     _menu.Update();
     if (_menu.GetSelectedItem("No! (Return to Menu)"))
     {
         _menuStack.Pop();
         _systemMain.SetStack(_menuStack);
     }
     if (_menu.GetSelectedItem("Yes! (Start Quiz)"))
     {
         _booklet.Reset();
         _menuStack.Push(new QuizDisplay(_booklet.GetNextQuiz(), this));
         _systemMain.SetStack(_menuStack);
     }
 }
예제 #5
0
 public void Update()
 {
     _menu.Update();
     if (_menu.GetSelectedItem("Back"))
     {
         _menuStack.Pop();
         _systemMain.SetStack(_menuStack);
     }
 }