예제 #1
0
 private void InitEngine()
 {
     this.game = new GameData();
     Game = this.game;
     Framework = this;
     this.textureCollection = new SortedDictionary<string, Texture>();
     this.textureDisposePolicies = new SortedDictionary<string, TextureDisposePolicy>();
     this.timer = new Stopwatch();
     this.InitRendering();
     this.updateFrameTime = Stopwatch.Frequency / ((long) this.updateFPS);
     this.renderFrameTime = Stopwatch.Frequency / ((long) this.renderFPS);
     this.InitInput();
     this.LoadConfig();
     this.InitSounds();
     this.game.InitGame();
     this.quitDialog = new QuitDialog();
     this.drawColor = Color.White;
     this.transState = TransState.Showing;
     this.running = true;
     this.gameWindow.Location = new Point(200, 200);
     this.gameWindow.Show();
 }
예제 #2
0
 public static void StartGame(bool p_fullscreen, bool p_doubleSize, string customMap)
 {
     GameEngine engine = null;
     try
     {
         engine = new GameEngine(p_fullscreen, p_doubleSize, customMap);
         engine.InitEngine();
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message);
         if (engine != null)
         {
             engine.Quit();
         }
         return;
     }
     engine.GameLoop();
 }