本文整理汇总了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();
}
}
示例2: StartGame
public void StartGame()
{
//this.simpleSound.Stop();
KeyboardController keyboardController = new KeyboardController();
GameEngine game = new GameEngine(keyboardController);
game.Run();
}
示例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();
}
}
示例4: Main
private static void Main()
{
using (var engine = new GameEngine(
"Red Line",
CreateMainMenuScene))
{
engine.Run();
}
}
示例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);
}
}
示例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();
}
}
示例7: Main
static void Main(string[] args)
{
IGameEngine currentEngine = new GameEngine();
currentEngine.Run();
}
示例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;
}
}