/// <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()
        {
            // TODO: Add your initialization logic here
            resumevideogame = new ResumeVideoGame();
            jobskills       = new JobSkills();
            gamestates      = GameStates.gameplay;
            playvideostate  = new PlayVideoState();

            ScreenManager.Instance.Initialize();

            ScreenManager.Instance.Dimensions  = new Vector2(800, 600);
            graphics.PreferredBackBufferWidth  = (int)ScreenManager.Instance.Dimensions.X;
            graphics.PreferredBackBufferHeight = (int)ScreenManager.Instance.Dimensions.Y;
            #endregion
            graphics.ApplyChanges();

            //after several seconds disappear
            // gametime
            gameTime = new GameTime();
            timeSpan = new TimeSpan();
            // gametime
            base.Initialize();
        }
Exemple #2
0
        public void Initialize()
        {
            playvideoostates = new PlayVideoState[2];
            // logintitlescreen = new LoginTitleScreen();

            DataContractSerializer resumeds     = new DataContractSerializer(typeof(ResumeVideoGame));
            FileStream             resumefs     = new FileStream("DefaultResumeGamePlay.xml", FileMode.Open);
            XmlDictionaryReader    resumereader =
                XmlDictionaryReader.CreateTextReader(resumefs, new XmlDictionaryReaderQuotas());

            resumevideogame = (ResumeVideoGame)resumeds.ReadObject(resumereader);

            /*  using (Stream s = File.OpenRead("LevelTwoTitleScreen.xml"))
             *    levelTwoOpeningTitleScreen = (OpeningTitleScreen)ds.ReadObject(s); */

            /*
             * DataContractSerializer ds = new DataContractSerializer(typeof(PlayVideoState));
             * FileStream fs = new FileStream("DefaultPlayVideoState.xml", FileMode.Open);
             * XmlDictionaryReader reader =
             *  XmlDictionaryReader.CreateTextReader(fs, new XmlDictionaryReaderQuotas());
             * playvideostate = (PlayVideoState)ds.ReadObject(reader);
             */

            // playvideostate = new PlayVideoState();
            //  jobskills = new JobSkills();

            //LevelTwoTitleScreen

            /*
             *
             * DataContractSerializer ds = new DataContractSerializer(typeof(OpeningTitleScreen));
             * FileStream fs = new FileStream("LevelTwoTitleScreen.xml", FileMode.Open);
             * XmlDictionaryReader reader =
             *  XmlDictionaryReader.CreateTextReader(fs, new XmlDictionaryReaderQuotas());
             * levelTwoOpeningTitleScreen = (OpeningTitleScreen)ds.ReadObject(reader);
             * currentScreen = levelTwoOpeningTitleScreen;
             *
             */

            //uncomment this for regular screen

            /*
             * DataContractSerializer ds = new DataContractSerializer(typeof(MainScreen));
             * FileStream fs = new FileStream("MainOpeningScreen.xml", FileMode.Open);
             * XmlDictionaryReader reader =
             *  XmlDictionaryReader.CreateTextReader(fs, new XmlDictionaryReaderQuotas());
             * OpeningMainScreen = (MainScreen)ds.ReadObject(reader);
             * currentScreen = OpeningMainScreen;
             */

            // this is the special screen for wakanda con

            DataContractSerializer ds     = new DataContractSerializer(typeof(MainScreen));
            FileStream             fs     = new FileStream("WakandaConMainOpeningScreen.xml", FileMode.Open);
            XmlDictionaryReader    reader =
                XmlDictionaryReader.CreateTextReader(fs, new XmlDictionaryReaderQuotas());

            OpeningMainScreen = (MainScreen)ds.ReadObject(reader);
            currentScreen     = OpeningMainScreen;



            /*
             * DataContractSerializer ds = new DataContractSerializer(typeof(OpeningTitleScreen));
             * FileStream fs = new FileStream("WakandaTitleScreen.xml", FileMode.Open);
             * XmlDictionaryReader reader =
             *  XmlDictionaryReader.CreateTextReader(fs, new XmlDictionaryReaderQuotas());
             * levelTwoOpeningTitleScreen = (OpeningTitleScreen)ds.ReadObject(reader);
             * //  fs.Close();
             * currentScreen = levelTwoOpeningTitleScreen;
             */
            //ScreenManager.Instance.AddScreen(ScreenManager.Instance.currentTitleScreen);



            // currentScreen = new LevelSelectScreen();

            /*
             * var writer = new FileStream("DefaultEndScreen.xml", FileMode.Create);
             * DataContractSerializer ser = new DataContractSerializer(typeof(JobSkills));
             * ser.WriteObject(writer, jobskills);
             * writer.Close();
             */
            // levelTwoOpeningTitleScreen = new OpeningTitleScreen();



            // currentScreen = levelTwoOpeningTitleScreen;

            /*
             * currentScreen = new OpeningTitleScreen();
             *
             */
        }