Ejemplo n.º 1
0
        static void Main()
        {
            IPEndPoint serverEndpoint = null;


            try
            {
                string connection = File.ReadAllText(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "Connection.txt"));
                if (IPEndPoint.TryParse(connection, out IPEndPoint result))
                {
                    if (result != null)
                    {
                        serverEndpoint = result;
                    }
                }
            }
            catch (Exception)
            {
            }


            using (var game = new PlayerdomGame(serverEndpoint))
            {
                game.Window.AllowUserResizing = true;

                game.Exiting += (object sender, EventArgs e) =>
                {
                    game.Dispose();
                };

                game.Run();
            }
        }
Ejemplo n.º 2
0
        public GamePage()
        {
            this.InitializeComponent();

            // Create the game.
            var launchArguments = string.Empty;

            _game = MonoGame.Framework.XamlGame <PlayerdomGame> .Create(launchArguments, Window.Current.CoreWindow, swapChainPanel);
        }