Exemplo n.º 1
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        ///
        /// Select - Layer5 added by Matthew Baldock
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            //Allows game to exit.
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed ||
                Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }


            //particleEngine.EmitterLocation = new Vector2(Mouse.GetState().X, Mouse.GetState().Y);
            particleEngine.Update(gameTime);

            //Update the current state
            switch (currentGameState)
            {
            case GameState.Login:
                login_menu.Update(gameTime);
                break;

            case GameState.MainMenu:
                main_menu.Update(gameTime);
                break;

            case GameState.Multiplayer:
                multiplayer_menu.Update(gameTime);
                break;

            case GameState.Options:
                options_menu.Update(gameTime);
                break;

            case GameState.Credits:
                credits_menu.Update(gameTime);
                break;

            case GameState.CreateLobby:
                create_lobby_menu.Update(gameTime);
                break;

            case GameState.LobbyBrowser:
                lobby_browser_menu.Update(gameTime);
                break;

            case GameState.Lobby:
                lobby_menu.Update(gameTime);
                break;

            case GameState.Playing:
                gameplayScreen.Update(gameTime);
                break;

            case GameState.Select:
                shipselectionScreen.update();
                break;

            case GameState.ControlMenu:
                control_menu.Update(gameTime);
                break;

            default:
                break;
            }

            base.Update(gameTime);
        }
Exemplo n.º 2
0
 public override void Update(GameTime gameTime)
 {
     LobbyMenu.Update(gameTime);
 }