Esempio n. 1
0
    private void Update()
    {
        if (IsGameLost || bossFight) // or bossfight
        {
            return;
        }

        if (!spawningEnemyCooldown.IsOnCooldown())
        {
            SpawnEnemies();
            spawnCount++;

            if (spawnCount == increasingLevelNumber)
            {
                difficultyLevel++;
                spawnCount = 0;
                UIManager.Instance.UpdateWaveCount(difficultyLevel + 1);

                if ((difficultyLevel + 1) % 3 == 0)
                {
                    bossFight = true;
                    SpawnBoss();
                    bossCount++;
                }
            }
        }

        if (!spawningRocketCooldown.IsOnCooldown())
        {
            SpawnRocket(new Vector3(PlayerTransform.position.x, 2));
            rocketCooldown = BaseRocketTimer - difficultyLevel / 3 - Random.Range(0, BaseRocketTimer / 2);
        }
    }
Esempio n. 2
0
    private void Update()
    {
        GetPlayerInput();

        if (!shootingCooldown.IsOnCooldown() && isVulnerable)
        {
            MyWeapon.Shoot(MyWeaponStats);
        }
    }