Пример #1
0
        protected override void UpdateScreen(GameTime gameTime)
        {
            if (_session.IsPaused)
            {
                FreezeScreen();
                ScreenManager.AddScreen(new PauseScreen(this, _session));
            }

            _session.Level.Paddle.StopMoving();
            if (InputMap.ActionPressed("MoveLeft"))
            {
                _session.Level.Paddle.MoveLeft();
            }
            else if (InputMap.ActionPressed("MoveRight"))
            {
                _session.Level.Paddle.MoveRight();
            }

            if (InputMap.NewActionPress("FireBall"))
            {
                _session.Level.Ball.Fire();
            }

            if (InputMap.NewActionPress("Pause"))
            {
                _session.Pause();
            }

            _session.Update(gameTime);
        }