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

            switch (scene0.State + scene1.State + scene2.State)
            {
            case 0:
                scene0.Show();
                scene1.Hide();
                scene2.Hide();
                break;

            case 1:
                scene0.Hide();
                scene1.Show();
                scene2.Hide();
                break;

            case 2:
                scene0.Hide();
                scene1.Hide();
                scene2.Show();
                break;
            }
            base.Update(gameTime);
        }
Example #2
0
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                Exit();
            }

            switch (_scene0.State + _scene1.State)
            {
            case 0:
                _scene0.Show();
                _scene1.Hide();
                break;

            case 1:
                _scene0.Hide();
                _scene1.Show();
                break;

            case 2:
                _scene0.Hide();
                _scene1.Hide();
                if (_scene2 == null)
                {
                    _scene2 = new Scene2(this, _device);
                    Components.Add(_scene2);
                }
                _scene2.Show();
                break;
            }
            base.Update(gameTime);
        }