Ejemplo n.º 1
0
        public void LoadContent()
        {
            if (_game.PrevGameState != GameState.PAUSED)
            {
                _game.CurrentPlayingState.ResetMovement();
                _game.CurrentPlayingState.Characters.Clear();
            }

            _pauseButton = new Button(
                onClickAction: () =>
            {
                _game.CurrentPlayingState.Movement   = _currentLevel.Player.GetMovement();
                _game.CurrentPlayingState.Characters = _currentLevel.Characters;
                _game.ChangeGameState(GameState.PAUSED);
            },
                buttonTexture: Utility.LoadTexture(_game, "SpriteSheets/Buttons/PauseButton"),
                position: new Vector2(_game.GraphicsDevice.Viewport.Width - PAUSE_BUTTON_OFFSET, PAUSE_BUTTON_OFFSET - PAUSE_BUTTON_HEIGHT),
                buttonSpriteRectangle: new Rectangle(3, 2, 10, 10),
                height: 20
                );

            _currentLevel = _levelFactory.LoadLevel(_game.CurrentPlayingState.SelectedLevel);
            _currentLevel.Create();
        }