当前位置: 首页>>代码示例>>C#>>正文


C# GameEngine.Run方法代码示例

本文整理汇总了C#中GameEngine.Run方法的典型用法代码示例。如果您正苦于以下问题:C# GameEngine.Run方法的具体用法?C# GameEngine.Run怎么用?C# GameEngine.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameEngine的用法示例。


在下文中一共展示了GameEngine.Run方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

 static void Main()
 {
     using (var game = new GameEngine())
     {
         game.Run();
     }
 }
开发者ID:BadassGamingCrew,项目名称:Chess-Might-and-Magic,代码行数:7,代码来源:EntryPoint.cs

示例2: StartGame

 public void StartGame()
 {
     //this.simpleSound.Stop();
     KeyboardController keyboardController = new KeyboardController();
     GameEngine game = new GameEngine(keyboardController);
     game.Run();
 }
开发者ID:Team-Utapau,项目名称:OOP-Project,代码行数:7,代码来源:MainGameMenu.cs

示例3: Main

 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (GameEngine game = new GameEngine(800, 640, true))
     {
         game.Run();
     }
 }
开发者ID:akbiggs,项目名称:Trauma,代码行数:10,代码来源:Program.cs

示例4: Main

 private static void Main()
 {
     using (var engine = new GameEngine(
         "Red Line",
         CreateMainMenuScene))
     {
         engine.Run();
     }
 }
开发者ID:EdgeWorks-Games,项目名称:DeferVox,代码行数:9,代码来源:Program.cs

示例5: Main

 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     AppDomain.CurrentDomain.UnhandledException += HandleAppDomainCurrentDomainUnhandledException; ;
     try
     {
         using (GameEngine game = new GameEngine())
         {
             game.Run();
         }
     }
     catch (Exception ex)
     {
         LogError(ex);
     }
 }
开发者ID:valsavva,项目名称:dynacat,代码行数:18,代码来源:Program.cs

示例6: Main

        static void Main()
        {

            //string test = "Hydrate-Kenny_Beltrey.ogg";
            //AudioFile testFile = new AudioFile(test);
            //testFile.Play();
            // The 'using' idiom guarantees proper resource cleanup.
            // We request 30 UpdateFrame events per second, and unlimited
            // RenderFrame events (as fast as the computer can handle). (may change this in the future, or set it as an option)
            
            // Initialize the audio context and xram for sound
            AudioContext ac = new AudioContext();
            XRamExtension xr = new XRamExtension();
            using (GameEngine engine = new GameEngine())
            {
                engine.Run();
            }
        }
开发者ID:Munk801,项目名称:Journey-to-the-West-Video-Game,代码行数:18,代码来源:EntryPoint.cs

示例7: Main

 static void Main(string[] args)
 {
     IGameEngine currentEngine = new GameEngine();
     currentEngine.Run();
 }
开发者ID:ROSSFilipov,项目名称:CSharp,代码行数:5,代码来源:ExamMain.cs

示例8: Main

        /// <summary>
        /// Main entry point.
        /// </summary>
        /// <param name="args">Program arguments.</param>
        public static void Main(string[] args)
        {
            if (!Directory.Exists("config") ||
                !Directory.Exists("content") ||
                !Directory.Exists("scripts"))
            {
                Console.BackgroundColor = ConsoleColor.DarkRed;
                Console.WriteLine("FATAL ERROR: The working directory seems to be incorrect (directories missing).");
                Console.BackgroundColor = ConsoleColor.Black;
                Console.WriteLine("Press any key to continue...");
                Console.ReadKey();
                return;
            }

            if (!File.Exists("config/logging.xml") ||
                !File.Exists("config/engine.ini") ||
                !File.Exists("config/input.ini"))
            {
                Console.BackgroundColor = ConsoleColor.DarkRed;
                Console.WriteLine("FATAL ERROR: Missing configuration files.");
                Console.BackgroundColor = ConsoleColor.Black;
                Console.WriteLine("Press any key to continue...");
                Console.ReadKey();
                return;
            }

            XmlConfigurator.Configure(new System.IO.FileInfo("config/logging.xml"));

            Log.Info("New session started.");
            #if DEBUG
            Log.Info("Running in DEBUG mode");
            #else
            Log.Info("Running in RELEASE mode");
            #endif

            Console.CancelKeyPress += new ConsoleCancelEventHandler(CancelHandler);
            Log.Debug("Registered ConsoleCancelEvent handler");

            engine = new GameEngine();

            try
            {
                if (engine.Run())
                {
                    Log.Info("Session ended normally.");
                }
                else
                {
                    Log.Warn("Session ended with errors.");
                    Console.WriteLine("Press any key to continue...");
                    Console.ReadKey();
                }
            }
            #if !DEBUG
            catch (Exception e)
            {
                Log.Fatal("Session ended with exception.", e);
                Console.WriteLine("Press any key to continue...");
                Console.ReadKey();
            }
            #endif
            finally
            {
                GameEngine.CleanupInstance();
                engine = null;
            }
        }
开发者ID:redxdev,项目名称:dive,代码行数:71,代码来源:Program.cs


注:本文中的GameEngine.Run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。