Example #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);
            }
        }
Example #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();
            }
        }
Example #3
0
 public void Update()
 {
     _menu.Update();
     if (_menu.GetSelectedItem("Back"))
     {
         _menuStack.Pop();
         _systemMain.SetStack(_menuStack);
     }
 }
Example #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);
     }
 }