Exemple #1
0
        public StackEngine(StackGame game, IServiceProvider services, InputProvider input, GameSettings gameSettings)
        {
            GameSettings = gameSettings;
            Services     = services;
            gameSettings.SetCulture();

            var ConsoleLogHandler = new ConsoleLogHandler(Console);

            EngineContent = new ContentLoader(Services);
            Renderer      = new Renderer(Services, EngineContent, game.VirtualResolution, gameSettings.GetTargetResolution(game.VirtualResolution), gameSettings.Bloom);

            Game = game;

            Console = new Console(this);
            ConsoleLogHandler.Console = Console;
            _Paused = true;

            InputProvider = input;

            if (InputProvider != null)
            {
                InputProvider.DisplaySettings = Renderer.DisplaySettings;
            }

            EngineVariables.EnableGUI = true;
            Game.Start(this);
        }
Exemple #2
0
        public Window(StackGame game) : base()
        {
            Game = game;

            Log.AddLogger(new DebugLogHandler());
            Log.WriteLine("Loading game settings");

            GameSettings = GameSettings.LoadFromConfigFile(Game.SaveGameFolder);

            Log.WriteLine("Initializing graphics");

            Graphics = GameSettings.CreateGraphicsDeviceManager(this);

            Window.ClientSizeChanged += OnClientSizeChanged;
            Window.AllowUserResizing  = true;
            Window.Title              = game.Title;

            SkipText     = new SkipText();
            SkipCutscene = new SkipCutscene(SetSpeed);
        }