示例#1
0
        /// <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();
        }
示例#2
0
 public void LoadGameFromSaved(SavedGame sG)
 {
     currentGame = new Game(this);
     currentScreen = currentGame.BeginFromSaved(sG);
 }
示例#3
0
        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
            {

            }
        }
示例#4
0
 public TitleScreen(Master master)
 {
     this.master = master;
     this.savedGame = master.savedGame;
     if (savedGame == null)
         saveFailed = true;
     PlaySong.Play(PlaySong.SongName.Title);
 }