private void StartPlayingNewGame(GameDifficulty gameDifficulty, GameSurvivor gameSurvivor, Boolean autoReload, Boolean weaponsUnlocked) { this.Options = new GameOptions(gameDifficulty, gameSurvivor, autoReload, weaponsUnlocked); this.StartPlayingGame(); // Create Entities SurvivorSubsystem.AddPlayerOneSurvivorSprite(new SurvivorSprite(this, new Location(new Vector2(100.0f, 100.0f), 1.0f, 0.0f))); // Unlock Weapons if Option Selected if (Options.WeaponsUnlocked) { SurvivorSubsystem.PlayerOneSurvivorSprite.EnableWeapon(SurvivorSprite.CROWBAR_WEAPON_INDEX); SurvivorSubsystem.PlayerOneSurvivorSprite.EnableWeapon(SurvivorSprite.CHAINSAW_WEAPON_INDEX); SurvivorSubsystem.PlayerOneSurvivorSprite.EnableWeapon(SurvivorSprite.PISTOL_WEAPON_INDEX); SurvivorSubsystem.PlayerOneSurvivorSprite.EnableWeapon(SurvivorSprite.SHOTGUN_WEAPON_INDEX); } // Reset Stats this.Results = new GameResults(); this.GamePaused = false; }
private void StartPlayingSavedGame(GameSaveStruct saveStruct) { this.Options = new GameOptions(saveStruct.Options); this.StartPlayingGame(); SurvivorSubsystem.AddPlayerOneSurvivorSprite(new SurvivorSprite(this, saveStruct.PlayerOneSurvivorSprite)); foreach (ZombieSpriteSaveStruct zombieSpriteSaveStruct in saveStruct.ZombieSprites) { ZombieSprite zombieSprite = new ZombieSprite(this, zombieSpriteSaveStruct); ZombiesSubsystem.AddZombieSprite(zombieSprite); } foreach (CollectableSaveStruct collectableSaveStruct in saveStruct.Collectables) { CollectablesSubsystem.AddCollectable(new Collectable(this, collectableSaveStruct)); switch (collectableSaveStruct.CollectableEntityType) { case CollectableEntityType.Health: CollectablesSubsystem.HealthCollectablesSpawned++; break; case CollectableEntityType.Gasoline: CollectablesSubsystem.GasolineCollectablesSpawned++; break; case CollectableEntityType.PistolAmmo: CollectablesSubsystem.PistolAmmoCollectablesSpawned++; break; case CollectableEntityType.ShotgunAmmo: CollectablesSubsystem.ShotgunAmmoCollectablesSpawned++; break; case CollectableEntityType.Energy: CollectablesSubsystem.EnergyCollectablesSpawned++; break; default: break; } } // Reset Zombie Subsystem ZombiesSubsystem.WaveTimer = saveStruct.WaveTimer; AchievmentsSubsystem.Initialize(saveStruct.Achievments); this.Results = new GameResults(saveStruct.Stats); this.GamePaused = true; }