internal TowerAssault() { wiggles = this; Graphics = new GraphicsDeviceManager(GameInstance); Content.RootDirectory = "Content"; Settings = new GameSettings(); MenuScreen.Fontname = "Fonts/menufont"; SoundManager.Manager.SetContentManager(Content); Settings = GameSettings.LoadSettings(); Camera = new Camera( this, new Vector3(750, 750, 2500), Vector3.Zero, Vector3.Up); }
public static GameSettings LoadSettings() { GameSettings settings = null; if (File.Exists(FileName)) { XmlSerializer xmlSerializer = new XmlSerializer(typeof(GameSettings)); using (Stream settingsFileStream = File.OpenRead(FileName)) { settings = xmlSerializer.Deserialize(settingsFileStream) as GameSettings; return settings; } } else { // HACKPOLOGY: If there is no save, create one. This logic should be pulled out of // here. settings = new GameSettings(); settings.WriteSettings(); } return settings; }