コード例 #1
0
        // Updates. When the players clicks continue we go to
        // the next state that is specified in the switch case,
        // depending on which option we currently are at.
        public void Update(GameTime gameTime)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.M))
            {
                AudioManager.Instance.PlaySound("disaster");
            }
            if (!AudioManager.Instance.IsPlaying)
            {
                AudioManager.Instance.PlayNextInQueue(gameTime);
            }

            currentPosition = (OptionsState)controls.MoveOptionPositionVertically((int)currentPosition);

            switch (currentPosition)
            {
            case OptionsState.Singleplayer:
                controls.ContinueButton(GameManager.GameState.PlayingSinglePlayer);
                break;

            case OptionsState.Multiplayer:
                controls.ContinueButton(GameManager.GameState.MultiPlayer);
                break;

            case OptionsState.Exit:
                controls.ContinueButton(GameManager.GameState.Quit);
                break;
            }
        }
コード例 #2
0
        public void Update(GameTime gameTime)
        {
            currentPosition = (OptionsState)controls.MoveOptionPositionVertically((int)currentPosition);

            switch (currentPosition)
            {
            case OptionsState.StartServer:
                controls.ContinueButton(GameManager.GameState.MultiplayerStartServer);
                break;

            case OptionsState.StartClient:
                controls.ContinueButton(GameManager.GameState.MultiplayerConnectServer);
                break;

            case OptionsState.Back:
                controls.ContinueButton(GameManager.GameState.MainMenu);
                break;
            }
            //controls.GoBackButton();
        }
コード例 #3
0
        public void Update(GameTime gameTime)
        {
            CheckServerName();
            currentPosition = (OptionsState)controls.MoveOptionPositionVertically((int)currentPosition);

            switch (currentPosition)
            {
            case OptionsState.FindServer:
                controls.SearchForServerButton(networkConnectionManager);
                break;

            case OptionsState.ConnectedTo:

            case OptionsState.Play:
                controls.ContinueButton(GameManager.GameState.MultiplayerPlaying);
                break;

            case OptionsState.Back:
                controls.ContinueButton(GameManager.GameState.MainMenu);
                break;
            }
        }
コード例 #4
0
        public void Update(GameTime gameTime)
        {
            CheckServerName();
            currentPosition = (OptionsState)controls.MoveOptionPositionVertically((int)currentPosition);

            switch (currentPosition)
            {
            case OptionsState.StartServer:
                controls.StartServerButton(networkConnectionManager);
                break;

            case OptionsState.ServerName:

            case OptionsState.StartMatch:
                controls.ContinueButton(GameManager.GameState.MultiplayerPlaying);
                break;

            case OptionsState.Back:
                controls.GoBackButton(peer: networkConnectionManager.GetPeer());
                break;
            }
        }