protected override void LoadContent()
        {
            Fonts.LoadFonts(Content, "Fonts.xml");
            Sounds.LoadSounds(Content, "Sounds.xml");

            // Load Game Content
            startingSpriteBatch = new SpriteBatch(this.graphics.GraphicsDevice);

            // Get Screen Size
            int screenWidth  = this.Window.ClientBounds.Width;
            int screenHeight = this.Window.ClientBounds.Height;

            // Load Control Content
            TextPickerControl.LoadContent(Content);

            // Load Screen Content
            SplashScreen.LoadContent(Content);
            SetupScreen.LoadContent(Content);
            InstructionsScreen.LoadContent(Content);
            GameOverScreen.LoadContent(Content);
            LoadScreens();

            // Load Subsystem Contents
            SurvivorSubsystem.LoadContent(Content);
            ZombiesSubsystem.LoadContent(Content);
            CollectablesSubsystem.LoadContent(Content);
            AchievmentsSubsystem.LoadContent(Content);

            // Load Entity Contents
            HUD.LoadContent(Content, screenWidth, screenHeight);

            String saveFilePath = Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "save.sav");

            if (File.Exists(saveFilePath))
            {
                FileStream     fileStream     = File.OpenRead(saveFilePath);
                XmlSerializer  fileSerializer = new XmlSerializer(typeof(GameSaveStruct));
                GameSaveStruct gameSaveStruct = (GameSaveStruct)fileSerializer.Deserialize(fileStream);
                fileStream.Close();
                File.Delete(saveFilePath);
                GameState = GameState.Playing;
                this.StartPlayingSavedGame(gameSaveStruct);
            }
            else
            {
                ResetToStarting(true);
            }

            base.LoadContent();
        }
Exemple #2
0
 public SetupScreen(Game game)
     : base(game)
 {
     difficultyTextPickerControl      = new TextPickerControl("Difficulty:", DIFFICULTY_TEXT_STRINGS, 0, DIFFICULTY_TEXT_PICKER_ORIGIN + DrawOffsetVector);
     survivorTextPickerControl        = new TextPickerControl("Survivor:", SURVIVOR_TEXT_STRINGS, 0, SURVIVOR_TEXT_PICKER_ORIGIN + DrawOffsetVector);
     autoReloadTextPickerControl      = new TextPickerControl("Auto Reload:", AUTO_RELOAD_TEXT_STRINGS, 0, AUTO_RELOAD_TEXT_PICKER_CONTROL_ORIGIN + DrawOffsetVector);
     weaponsUnlockedTextPickerControl = new TextPickerControl("Weapons Unlocked:", WEAPONS_UNLOCKED_TEXT_STRINGS, 0, WEAPONS_UNLOCKED_TEXT_PICKER_CONTROL_ORIGIN + DrawOffsetVector);
     textPickerControls = new TextPickerControl[4] {
         difficultyTextPickerControl,
         survivorTextPickerControl,
         autoReloadTextPickerControl,
         weaponsUnlockedTextPickerControl
     };
     difficultyTextPickerControl.Focus = true;
 }
 public SetupScreen(Game game)
     : base(game)
 {
     difficultyTextPickerControl = new TextPickerControl("Difficulty:", DIFFICULTY_TEXT_STRINGS, 0, DIFFICULTY_TEXT_PICKER_ORIGIN + DrawOffsetVector);
     survivorTextPickerControl = new TextPickerControl("Survivor:", SURVIVOR_TEXT_STRINGS, 0, SURVIVOR_TEXT_PICKER_ORIGIN + DrawOffsetVector);
     autoReloadTextPickerControl = new TextPickerControl("Auto Reload:", AUTO_RELOAD_TEXT_STRINGS, 0, AUTO_RELOAD_TEXT_PICKER_CONTROL_ORIGIN + DrawOffsetVector);
     weaponsUnlockedTextPickerControl = new TextPickerControl("Weapons Unlocked:", WEAPONS_UNLOCKED_TEXT_STRINGS, 0, WEAPONS_UNLOCKED_TEXT_PICKER_CONTROL_ORIGIN + DrawOffsetVector);
     textPickerControls = new TextPickerControl[4] {
         difficultyTextPickerControl,
         survivorTextPickerControl,
         autoReloadTextPickerControl,
         weaponsUnlockedTextPickerControl
     };
     difficultyTextPickerControl.Focus = true;
 }