public MainPage() { this.InitializeComponent(); ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize; ApplicationView.PreferredLaunchViewSize = new Size(800, 600); CanvasWidth = MyCanvas.Width; CanvasHeight = MyCanvas.Height; // create a new game game = new Game(MyCanvas); game.StartGame(); }
private async void LoadXML() { XmlSerializer serializer = new XmlSerializer(typeof(Game)); StorageFolder folder = Windows.ApplicationModel.Package.Current.InstalledLocation; StorageFile file = await folder.GetFileAsync(@"Assets\game.xml"); Stream stream = await file.OpenStreamForReadAsync(); this.GameSource = (Game)serializer.Deserialize(stream); stream.Dispose(); this.Game = new SaveGameData(); //this.isLoadedGame = this.LoadGame("Autosave.xml"); if (isLoadedGame == false) { this.InitializeGame(); } this.ExecuteEpizode(this.Game.CurrentEpizode); }