Ejemplo n.º 1
0
    public void DecreaseWordCount()
    {
        wordCount--;
        //Check for boss
        isBoss = IsBoss();
        if (isBoss == true)
        {
            UdemyBoss boss = this.GetComponent <UdemyBoss>();
            //? do we need this

            boss.Damage(1);

            if (boss.CurrentHealth > 0)
            {
                SpawnNewWords();
                return;
            }
            else
            {
                Destroy(gameObject);
                spawnWave.EnemyKilled(this.gameObject);
                if (spawnWave.enemiesAlive.Count == 0)
                {
                    spawnWave.SpawnNewEnemies();
                }
            }
        }
        //If Not Boss
        if (wordCount <= 0)
        {
            GetComponentInChildren <SpriteRenderer>().enabled = false;
            spawnWave.EnemyKilled(this.gameObject);
            Invoke("DestroyAfterAudio", 1);

            if (spawnWave.enemiesAlive.Count == 0)
            {
                spawnWave.SpawnNewEnemies();
            }
        }
    }
Ejemplo n.º 2
0
 public void Die()
 {
     mainMusic.Play();
     spawnWave.ClearBossWave(player);
     spawnWave.SpawnNewEnemies();
 }