Пример #1
0
 void Start()
 {
     // Reduce player health based on the difficulty chosen
     playerHealth = baseHealth - PlayerPrefsController.GetDifficultyLevel();
     healthText   = GetComponent <Text>();
     UpdateDisplay();
 }
Пример #2
0
    private IEnumerator Start()
    {
        var difficultyLevel = PlayerPrefsController.GetDifficultyLevel();

        if (difficultyLevel == 1)
        {
            maxSpawnDelay    = 10;
            minSpawnDelay    = 8;
            waitingTime      = 15f;
            waitingtimeJabba = 20f;
            waitingtimeBundi = 25f;
        }
        if (difficultyLevel == 2)
        {
            maxSpawnDelay    = 8;
            minSpawnDelay    = 6;
            waitingTime      = 12f;
            waitingtimeJabba = 17f;
            waitingtimeBundi = 22f;
        }
        if (difficultyLevel == 3)
        {
            maxSpawnDelay    = 6;
            minSpawnDelay    = 4;
            waitingTime      = 10f;
            waitingtimeJabba = 15f;
            waitingtimeBundi = 20f;
        }
        yield return(new WaitForSeconds(waitingTime));

        StartCoroutine(SpawnWave());
    }
 void Start()
 {
     musicPlayer            = FindObjectOfType <MusicPlayer>();
     volumeText.text        = (volumeSlider.value * 100).ToString() + "%";
     volumeSlider.value     = PlayerPrefsController.GetMasterVolume();
     difficultyLevelWords   = new string[] { "Easy", "Normal", "Hard" };
     difficultySlider.value = PlayerPrefsController.GetDifficultyLevel();
 }
Пример #4
0
    void Awake()
    {
        attackerTier     = 0;
        levelController  = FindObjectOfType <LevelController>();
        difficultyLevel  = PlayerPrefsController.GetDifficultyLevel();
        preparationTime -= difficultyLevel * difficultyMultiplier;

        currentMinSpawnDelay = minSpawnDelay;
        currentMaxSpawnDelay = maxSpawnDelay;
    }
Пример #5
0
    private void Start()
    {
        playerHealth = baseHealth - PlayerPrefsController.GetDifficultyLevel();

        /*
         * float difficulty = PlayerPrefsController.GetDifficultyLevel();
         * playerHealth = playerHealth * (1 - difficulty);
         * playerHealth = Mathf.Round(playerHealth);
         */
        healthText = GetComponent <Text>();
        UpdateDisplay();
    }
Пример #6
0
    private IEnumerator Start()
    {
        var difficultyLevel = PlayerPrefsController.GetDifficultyLevel();
        var levelnumber     = PlayerPrefsController.getlevel();

        if (levelnumber == 1)
        {
            if (difficultyLevel == 1)
            {
                maxSpawnDelay = 4;
                minSpawnDelay = 4;
                waitingTime   = 10f;
            }
            if (difficultyLevel == 2)
            {
                maxSpawnDelay = 3;
                minSpawnDelay = 3;
                waitingTime   = 10f;
            }
            if (difficultyLevel == 3)
            {
                maxSpawnDelay = 2;
                minSpawnDelay = 2;
                waitingTime   = 10f;
            }
        }

        if (levelnumber == 2)
        {
            if (difficultyLevel == 1)
            {
                maxSpawnDelay = 5;
                minSpawnDelay = 3;
                waitingTime   = 15f;
            }
            if (difficultyLevel == 2)
            {
                maxSpawnDelay = 4;
                minSpawnDelay = 2;
                waitingTime   = 12f;
            }
            if (difficultyLevel == 3)
            {
                maxSpawnDelay = 3;
                minSpawnDelay = 1;
                waitingTime   = 10f;
            }
        }
        yield return(new WaitForSeconds(waitingTime));

        StartCoroutine(SpawnWave());
    }
Пример #7
0
    bool TriggeredLevelFinish = false; // bool created so that we can get out of the update function without getting stuck in looping

    private void Start()
    {
        var difficultyLevel = PlayerPrefsController.GetDifficultyLevel();
        var levelnumber     = PlayerPrefsController.getlevel();

        if (levelnumber == 1 || levelnumber == 2)
        {
            if (difficultyLevel == 1)
            {
                LevelTime = 40f;
            }
            if (difficultyLevel == 2)
            {
                LevelTime = 50f;
            }
            if (difficultyLevel == 3)
            {
                LevelTime = 60f;
            }
        }
        if (levelnumber == 3 || levelnumber == 4 || levelnumber == 5)
        {
            if (difficultyLevel == 1)
            {
                LevelTime = 100f;
            }
            if (difficultyLevel == 2)
            {
                LevelTime = 110f;
            }
            if (difficultyLevel == 3)
            {
                LevelTime = 120f;
            }
        }
    }
Пример #8
0
    private void SetLivesOnDifficulty()
    {
        var difficulty = PlayerPrefsController.GetDifficultyLevel();

        if (difficulty == 2f)
        {
            playerLives    = 1f;
            livesText.text = playerLives.ToString();
        }
        else if (difficulty == 1f)
        {
            playerLives    = 3f;
            livesText.text = playerLives.ToString();
        }
        else if (difficulty == 0f)
        {
            noLivesMode    = true;
            livesText.text = "∞";
        }
        else
        {
            Debug.LogError("Invalid Difficulty Level.");
        }
    }
Пример #9
0
 private void Start()
 {
     optionsScreen.SetActive(false);
     musicSlider.value      = PlayerPrefsController.GetMusicVolume();
     difficultySlider.value = PlayerPrefsController.GetDifficultyLevel();
 }
 // Start is called before the first frame update
 void Start()
 {
     musicPlayer            = FindObjectOfType <MusicPlayer>();
     volumeSlider.value     = PlayerPrefsController.GetMasterVolume();
     difficultySlider.value = PlayerPrefsController.GetDifficultyLevel();
 }
Пример #11
0
 // Start is called before the first frame update
 void Start()
 {
     volumeSlider.value     = PlayerPrefsController.GetMasterVolume();
     difficultySlider.value = PlayerPrefsController.GetDifficultyLevel();
 }
Пример #12
0
 private void Start()
 {
     lives     = baseLives - PlayerPrefsController.GetDifficultyLevel();
     livesText = GetComponent <TextMeshProUGUI>();
     UpdateDisplay();
 }