Ejemplo n.º 1
0
        /// <summary>
        /// Initialization
        /// </summary>
        /// <param name="content"><see cref="ContentServiceBase"/></param>
        public override void Initialize(ContentServiceBase content)
        {
            Width  = _config.ViewWidth;
            Height = _config.ViewHeight;

            base.Initialize(content);
        }
        /// <summary>
        /// State's initialize
        /// </summary>
        /// <param name="content"><see cref="ContentServiceBase"/></param>
        public override void Initialize(ContentServiceBase content)
        {
            Width          = _config.ViewWidth;
            Height         = _config.ViewHeight;
            _gameplayScene = new RenderTarget2D(content.Device, (int)Width, (int)Height);

            base.Initialize(content);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// State's initialization
        /// </summary>
        /// <param name="content"><see cref="ContentServiceBase"/></param>
        public override void Initialize(ContentServiceBase content)
        {
            Width  = _config.ViewWidth;
            Height = _config.ViewHeight;

            _buttons = new List <MenuButton>( )
            {
                new MenuButton(_input, _content)
                {
                    X       = 32, Y = Height - 96, Width = 256, Height = 48, Text = "back", Align = AlignType.CM,
                    OnClick = () => OnResume?.Invoke( )
                }
            };

            base.Initialize(content);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// State's initialization
        /// </summary>
        /// <param name="content"><see cref="ContentServiceBase"/></param>
        public override void Initialize(ContentServiceBase content)
        {
            Width  = _config.ViewWidth;
            Height = _config.ViewHeight;
            base.Initialize(content);

            _backButton = new MenuButton(_input, _content)
            {
                X = 32, Y = Height - 96, Width = 256, Height = 48, Text = "back", Align = AlignType.CM, OnClick = () => OnResume?.Invoke( )
            };
            _saveButton = new MenuButton(_input, _content)
            {
                X = 32, Y = Height - 144, Width = 256, Height = 48, Text = "save_changes", Align = AlignType.CM, OnClick = () => {
                    _changedConfig.ForEach(key => _config.Configuration[key] = _cfg[key]);
                    _config.AssignIngameConfiguration( );
                    _content.UpdateDynamicContent(_config);
                    _state.ReinitializeStates(_content, _config);
                }
            };
        }
        /// <summary>
        /// State's initialization
        /// </summary>
        /// <param name="content"><see cref="ContentServiceBase"/></param>
        public override void Initialize(ContentServiceBase content)
        {
            Width  = _config.ViewWidth;
            Height = _config.ViewHeight;

            _buttons = new List <Button>( )
            {
                new MenuButton(_input, _content)
                {
                    X = 32, Y = Height - 384, Width = 256, Height = 48, Align = AlignType.CM, Text = "new_game", OnClick = () => _console.ExecuteCommand("new_game")
                },
                new MenuButton(_input, _content)
                {
                    X = 32, Y = Height - 288, Width = 256, Height = 48, Align = AlignType.CM, Text = "how_to_play", OnClick = () => _state.ChangeState(GameStateType.Tutorial)
                },
                new MenuButton(_input, _content)
                {
                    X = 32, Y = Height - 240, Width = 256, Height = 48, Align = AlignType.CM, Text = "settings", OnClick = () => {
                        _state.ChangeState(GameStateType.Settings);
                        ((SettingsState)_state.GetCurrentState( )).OnResume = () => _state.ChangeState(GameStateType.MainMenu);
                    }
                },
                new MenuButton(_input, _content)
                {
                    X = 32, Y = Height - 192, Width = 256, Height = 48, Align = AlignType.CM, Text = "credits", OnClick = () => _state.ChangeState(GameStateType.Credits)
                },
                new MenuButton(_input, _content)
                {
                    X = 32, Y = Height - 96, Width = 256, Height = 48, Align = AlignType.CM, Text = "exit_app", OnClick = () => _console.ExecuteCommand("exit")
                }
            };
            // Temporary, if there is game save, continue button should be displayed
            _buttons.Add(new MenuButton(_input, _content)
            {
                X = 32, Y = Height - 432, Width = 256, Height = 48, Align = AlignType.CM, Text = "continue"
            });

            base.Initialize(content);
        }