예제 #1
0
        public void update()
        {
            if (Mouse.GetState().X > 441 &&
                Mouse.GetState().X < 441 + 400 &&
                Mouse.GetState().Y > 360 &&
                Mouse.GetState().Y < 360 + 95)
            {
                //play_button_idle = play_button_click;
                if (Mouse.GetState().LeftButton == ButtonState.Pressed)
                {
                    //GameAndMenuState = GameAndMenu.GameState;
                }
            }
            else
            {
                //play_button_idle = play_button;
            }

            if (Mouse.GetState().X > 441 &&
                Mouse.GetState().X < 441 + 400 &&
                Mouse.GetState().Y > 587 &&
                Mouse.GetState().Y < 587 + 95)
            {
                //quit_button_idle = quit_button_click;
                if (Mouse.GetState().LeftButton == ButtonState.Pressed)
                {
                    Game1.Quit();
                }
            }
            else
            {
                //quit_button_idle = quit_button;
            }
        }
예제 #2
0
        public void update()
        {
            if (Mouse.GetState().X > 452 &&
                Mouse.GetState().X < 452 + 350 &&
                Mouse.GetState().Y > 291 &&
                Mouse.GetState().Y < 291 + 75)
            {
                m_PlayButton = m_PlayButtonClick;
                if (Mouse.GetState().LeftButton == ButtonState.Pressed)
                {
                    Game1.State = Game1.States.Game;
                }
            }
            else
            {
                m_PlayButton = m_PlayButtonIdle;
            }

            if (Mouse.GetState().X > 452 &&
                Mouse.GetState().X < 452 + 350 &&
                Mouse.GetState().Y > 386 &&
                Mouse.GetState().Y < 386 + 75)
            {
                m_HelpButton = m_HelpButtonClick;
                if (Mouse.GetState().LeftButton == ButtonState.Pressed)
                {
                    Game1.State = Game1.States.Instructions;
                }
            }
            else
            {
                m_HelpButton = m_HelpButtonIdle;
            }

            if (Mouse.GetState().X > 452 &&
                Mouse.GetState().X < 452 + 350 &&
                Mouse.GetState().Y > 481 &&
                Mouse.GetState().Y < 481 + 75)
            {
                m_HighscoreButton = m_HighscoreButtonClick;
                if (Mouse.GetState().LeftButton == ButtonState.Pressed)
                {
                    Game1.State = Game1.States.Highscore;
                }
            }
            else
            {
                m_HighscoreButton = m_HighscoreButtonIdle;
            }

            if (Mouse.GetState().X > 452 &&
                Mouse.GetState().X < 452 + 350 &&
                Mouse.GetState().Y > 577 &&
                Mouse.GetState().Y < 577 + 75)
            {
                m_QuitButton = m_QuitButtonClick;
                if (Mouse.GetState().LeftButton == ButtonState.Pressed)
                {
                    Game1.Quit();
                }
            }
            else
            {
                m_QuitButton = m_QuitButtonIdle;
            }
        }