/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { controls = new Controls(); globalRandom = new Random(); savedGame = LoadGame(); options = LoadOptions(); ActivateOptions(options); base.Initialize(); }
public void LoadGameFromSaved(SavedGame sG) { currentGame = new Game(this); currentScreen = currentGame.BeginFromSaved(sG); }
public void SaveGame(SavedGame game) { savedGame = game; XmlSerializer xS = new XmlSerializer(typeof(SavedGame)); try { StreamWriter sW = new StreamWriter("saved.xml"); xS.Serialize(sW, game); sW.Close(); } catch { } }
public TitleScreen(Master master) { this.master = master; this.savedGame = master.savedGame; if (savedGame == null) saveFailed = true; PlaySong.Play(PlaySong.SongName.Title); }