Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (transform.position != finalPosition)
        {
            transform.position = Vector3.Lerp(startPosition, finalPosition, Time.timeSinceLevelLoad * lerpSpeed / 100);
        }

        if (enemiesOnScreen < numEnemiesOnScreen && lastSpawn <= 0.0f)
        {
            HangerBaySpawn currentHander = hangers[Random.Range(0, hangers.Length)];
            currentHander.SpawnEnemy();
            enemiesOnScreen++;
            lastSpawn = spawnTimer;
            player.UpdateScore(-10);
        }

        if (lastSpawn > 0.0f)
        {
            lastSpawn -= Time.deltaTime;
        }

        if (criticalAreas == 0 && !isDead)
        {
            DestroyBoss();
        }
        else if (isDead)
        {
            FlashBoss();
        }
    }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        if (flashInTimePlayed > 0.0f)
        {
            FlashBoss();
            flashInTimePlayed -= Time.deltaTime;
        }

        if (enemiesOnScreen < numEnemiesOnScreen && lastSpawn <= 0.0f)
        {
            HangerBaySpawn currentHander = hangers[Random.Range(0, hangers.Length)];
            currentHander.SpawnEnemy();
            enemiesOnScreen++;
            lastSpawn = spawnTimer;
            player.UpdateScore(-10);
        }

        if (lastSpawn > 0.0f)
        {
            lastSpawn -= Time.deltaTime;
        }

        if (criticalAreas == 0 && !isDead)
        {
            DestroyBoss();
        }
        else if (isDead)
        {
            FlashBoss();
        }
    }