Exemplo n.º 1
0
 protected override void Init()
 {
     base.Init();
     audioSource.volume = AudioOptionController.GetZombiesVolume();
     audioSource.PlayOneShot(soundSpawn);
     StartCoroutine(RepickRoamDirection());
 }
Exemplo n.º 2
0
    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();
    }
Exemplo n.º 3
0
 public void BackToMainMenu()
 {
     mainMenu.SetActive(true);
     optionsMenu.SetActive(false);
     PlayerControls.SaveSettings();
     AudioOptionController.SaveSettings();
 }
Exemplo n.º 4
0
    // 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);
    }
Exemplo n.º 5
0
 public void Event(string text, AudioClip jingle = null)
 {
     if (isPlaying)
     {
         StartCoroutine(ShowEvent(text));
         if (jingle != null)
         {
             audioPlayer.PlayOneShot(jingle, AudioOptionController.GetJinglesVolume());
         }
     }
 }
Exemplo n.º 6
0
    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();
        }
    }
Exemplo n.º 7
0
 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());
 }
Exemplo n.º 8
0
 public void OpenGame()
 {
     PlayerControls.LoadSettings();
     AudioOptionController.LoadSettings();
 }