Example #1
0
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                this.Exit();
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                this.Exit();
            }

            switch (gameState)
            {
            case GameStates.Menu:
                //if (GamePad.GetState(PlayerIndex.One).Buttons.Start == ButtonState.Pressed)
                //{
                trashbot1 = new Trashbot(PlayerIndex.One);
                gameState = GameStates.Play;
                ItemPool.Start();
                //}
                break;

            case GameStates.Play:
                trashbot1.Update(gameTime);
                ItemPool.Update();
                break;
            }


            base.Update(gameTime);
        }
Example #2
0
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
                this.Exit();

            switch(gameState)
            {
                case GameStates.Menu:
                //if (GamePad.GetState(PlayerIndex.One).Buttons.Start == ButtonState.Pressed)
                //{
                    trashbot1 = new Trashbot(PlayerIndex.One);
                    gameState = GameStates.Play;
                    ItemPool.Start();
                //}
                break;
                case GameStates.Play:
                    trashbot1.Update(gameTime);
                    ItemPool.Update();
                break;
            }

            base.Update(gameTime);
        }