Ejemplo n.º 1
0
        private void SetupGameCore()
        {
            try
            {
                // Create a new GameCore, supplying this form.
                GameCore gc = new GameCore(this, GameModelDefaults.TickDurationMs);

                // Setup any custom fonts
                gc.AddCustomFont(GameModelDefaults.FontPrimaryFilePath, GameModelDefaults.FontNamePrimary);

                // Create your model, view, and controller, and register them with the game core.
                GameModel model = new GameModel();
                ControllerPrimaryInput controller = new ControllerPrimaryInput();
                ViewPrimary            view       = new ViewPrimary();
                gc.RegisterModelViewController(model, controller, view);

                // Kick off the loading of data.
                model.PreLoadInitialize();

                // Start the game!
                gc.Start();
            }
            catch (Exception exc)
            {
                MessageBox.Show("An exception occurred while setting up the game: " + exc.Message);
            }
        }