protected override void Init() { base.Init(); audioSource.volume = AudioOptionController.GetZombiesVolume(); audioSource.PlayOneShot(soundSpawn); StartCoroutine(RepickRoamDirection()); }
public IEnumerator ShowGameOver() { isPlaying = false; audioPlayer.clip = gameoverMusic; audioPlayer.Play(); yield return(new WaitForSeconds(1f)); audioPlayer.PlayOneShot(gameoverJingle, AudioOptionController.GetJinglesVolume()); DisplayGameOver(); DisplayStats(); yield return(new WaitForSeconds(0.3f)); DisplayScore(); yield return(new WaitForSeconds(0.3f)); DisplayTZK(); yield return(new WaitForSeconds(0.3f)); DisplayBDS(); yield return(new WaitForSeconds(0.3f)); DisplayTS(); yield return(new WaitForSeconds(0.3f)); DisplayHighScore(); yield return(new WaitForSeconds(0.3f)); DisplayTryAgain(); }
public void BackToMainMenu() { mainMenu.SetActive(true); optionsMenu.SetActive(false); PlayerControls.SaveSettings(); AudioOptionController.SaveSettings(); }
// Use this for initialization void Start() { // Init variables crushAreaMin = new Vector2(-bodyWidth / 2, -bodyThickness / 2); crushAreaMax = new Vector2(bodyWidth / 2, bodyThickness / 2); // Init the content of the dice diceContent.AddEffectHolder(new EffectHolder(new EffectScore(this, 100), 50)); diceContent.AddEffectHolder(new EffectHolder(new EffectSpawnZombie(this), 40)); diceContent.AddEffectHolder(new EffectHolder(new EffectSpawnHorde(this, 2), 30)); diceContent.AddEffectHolder(new EffectHolder(new EffectSpawnMaggot(this), 50)); diceContent.AddEffectHolder(new EffectHolder(new EffectSpawnHorde(this, 3), 20)); diceContent.AddEffectHolder(new EffectHolder(new EffectHealth(this, 1), 30)); diceContent.AddEffectHolder(new EffectHolder(new EffectZombieIncreaseSpawn(this, 1), 50)); diceContent.AddEffectHolder(new EffectHolder(new EffectZombieRageFaster(this, 1f), 10)); diceContent.AddEffectHolder(new EffectHolder(new EffectScore(this, 200), 30)); diceContent.AddEffectHolder(new EffectHolder(new EffectPlayerIncreaseMovementSpeed(this, 0.1f), 10)); isUsed = false; timeToDie = 3f; throwSpeedMax = 30f; speedUp = defaultSpeedUp; BoxCollider2D collisionBox = GetComponent <BoxCollider2D>(); collisionBox.size = new Vector2(bodyWidth, bodyThickness); collisionBox.offset = new Vector2(0, 0); audioSource.volume = AudioOptionController.GetZombiesVolume(); GameDirector.singleton.StartTrackingDice(this); }
public void Event(string text, AudioClip jingle = null) { if (isPlaying) { StartCoroutine(ShowEvent(text)); if (jingle != null) { audioPlayer.PlayOneShot(jingle, AudioOptionController.GetJinglesVolume()); } } }
public AudioClip floodJingle; // extra zombies // Use this for initialization void Start() { singleton = this; audioPlayer.volume = AudioOptionController.GetMusicVolume(); numberPlayers = players.Count; EffectSpawnHorde.eventClip = hordeJingle; StartCoroutine(PeriodicZombieSpawn()); StartCoroutine(PeriodicDiceSpawn()); foreach (PlayerScoreViewController psvc in playerScoreViewControllers) { psvc.UpdateView(); } }
protected override void Init() { base.Init(); if (playerSlot == PlayerSlot.Player1) { controls = PlayerControls.player1Control; } else { controls = PlayerControls.player2Control; } attackMask = (1 << 9) + (1 << 10); // MASK zombie + dice audioSource.volume = AudioOptionController.GetPlayersVolume(); StartCoroutine(PlaySpawnSound()); }
public void OpenGame() { PlayerControls.LoadSettings(); AudioOptionController.LoadSettings(); }