예제 #1
0
        public static void Run()
        {
            IGame game = AGSGame.CreateEmpty();

            _gameDebugView = new Lazy <GameDebugView>(() =>
            {
                var gameDebugView = new GameDebugView(game);
                gameDebugView.Load();
                return(gameDebugView);
            });

            //Rendering the text at a 4 time higher resolution than the actual game, so it will still look sharp when maximizing the window.
            GLText.TextResolutionFactorX = 4;
            GLText.TextResolutionFactorY = 4;

            game.Events.OnLoad.Subscribe(async() =>
            {
                game.Factory.Fonts.InstallFonts("../../Assets/Fonts/pf_ronda_seven.ttf", "../../Assets/Fonts/Pixel_Berry_08_84_Ltd.Edition.TTF");
                AGSGameSettings.DefaultSpeechFont     = game.Factory.Fonts.LoadFontFromPath("../../Assets/Fonts/pf_ronda_seven.ttf", 14f, FontStyle.Regular);
                AGSGameSettings.DefaultTextFont       = game.Factory.Fonts.LoadFontFromPath("../../Assets/Fonts/Pixel_Berry_08_84_Ltd.Edition.TTF", 14f, FontStyle.Regular);
                AGSGameSettings.CurrentSkin           = null;
                game.State.RoomTransitions.Transition = AGSRoomTransitions.Fade();
                setKeyboardEvents(game);
                Shaders.SetStandardShader();

                addDebugLabels(game);
                Debug.WriteLine("Startup: Loading Assets");
                await loadPlayerCharacter(game);
                Debug.WriteLine("Startup: Loaded Player Character");
                await loadSplashScreen(game);
            });

            game.Start(new AGSGameSettings("Demo Game", new AGS.API.Size(320, 200),
                                           windowSize: new AGS.API.Size(640, 400), windowState: WindowState.Normal));
        }
예제 #2
0
        public static void Run()
        {
            FakeAGSTestGameStarter starter = new FakeAGSTestGameStarter();
            var game = AGSGame.CreateEmpty();

            _gameDebugView = new Lazy <GameDebugView>(() =>
            {
                var gameDebugView = new GameDebugView(game, new KeyboardBindings(game.Input));
                gameDebugView.Load();
                return(gameDebugView);
            });

            starter.StartGame(game);

            Size screenSize = new AGS.API.Size(320, 200);
            int  factor     = 2;

            AGSGameSettings settings = new AGSGameSettings(
                "Demo Game",
                screenSize,
                windowSize: new AGS.API.Size(screenSize.Width * factor, screenSize.Height * factor),
                windowState: WindowState.Normal);

            game.Start(settings);
        }
예제 #3
0
파일: Program.cs 프로젝트: jdiperla/MonoAGS
        public static void Run()
        {
            DemoStarter starter = new DemoStarter();
            var         game    = AGSGame.CreateEmpty();

            _gameDebugView = new Lazy <GameDebugView>(() =>
            {
                var gameDebugView = new GameDebugView(game, new KeyboardBindings(game.Input));
                gameDebugView.Load();
                return(gameDebugView);
            });

            starter.StartGame(game);
            game.Start(new AGSGameSettings("Demo Game", new AGS.API.Size(320, 200),
                                           windowSize: new AGS.API.Size(640, 400), windowState: WindowState.Normal));
        }