Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        //spawn enemies in second phase:
        if (!firstphase)
        {
            currentEnemySpawnTime -= Time.deltaTime;
            if (currentEnemySpawnTime <= 0)
            {
                currentEnemySpawnTime = enemySpawnTime;
                enemySpawnController.SpawnAtRandomLocation(0);
                enemySpawnController.SpawnAtRandomLocation(1);
            }
        }

        if (isVulnerable && wizardHealth == maxHealth)
        {
            HUDWarning.SetActive(true);
        }
        else
        {
            HUDWarning.SetActive(false);
        }

        //  if(Input.GetKeyDown(KeyCode.Q))
        //  {
        //      ChangePhase();
        //  }

        if (wizardHealth < maxHealth)
        {
            if (wizardHealth < 0f)
            {
                wizardHealth = 0f;
            }
            if (NormalFaceSprite != null && AngerFaceSprite != null)
            {
                float healthPercentage = wizardHealth / maxHealth;
                NormalFaceSprite.color = new Color(1f, healthPercentage, healthPercentage);
                AngerFaceSprite.color  = new Color(1f, healthPercentage, healthPercentage);
            }
        }
    }
    public void SpawnWave(int level)
    {
        for (int i = 0; i < spawnList[level, 0]; i++)
        {
            spawnController.SpawnAtRandomLocation(0);
        }
        for (int i = 0; i < spawnList[level, 1]; i++)
        {
            spawnController.SpawnAtRandomLocation(1);
        }

        if (spawnList[level, 2] == 1)
        {
            //Senator Swill
            spawnController.SpawnBoss(EnemySpawnController.FIRST_BOSS_INDEX);
        }
        else if (spawnList[level, 2] == 2)
        {
            //Waste Wizard boss mode
            // Debug.Log("START BOSS");
            // spawnController.FinalBossActivate();
        }
    }