// Use this for initialization
 void Start()
 {
     volumeSlider.value     = PlayerPrefsController.GetMasterVolume();
     difficultySlider.value = PlayerPrefsController.GetMasterDifficulty();
     DisplayDifficulty();
     DisplayVolume();
 }
Exemple #2
0
 // Start is called before the first frame update
 void Start()
 {
     lives     = baseLives - PlayerPrefsController.GetMasterDifficulty();
     livesText = GetComponent <Text>();
     UpdateDisplay();
     //Debug.Log("difficulty setting currently is " + PlayerPrefsController.GetMasterDifficulty());
 }
Exemple #3
0
    private void SetSpawnDelay()
    {
        float difficultyFactor = (PlayerPrefsController.GetMasterDifficulty() * 2);

        minSpawnDelay -= difficultyFactor;
        maxSpawnDelay -= difficultyFactor;
    }
Exemple #4
0
 void Start()
 {
     currentTime           = Mathf.Round(levelTimeInSeconds * PlayerPrefsController.GetMasterDifficulty());
     timerImage            = GetComponent <Image>();
     timerImage.fillAmount = 1.0f;
     timerText.text        = (levelTimeInSeconds.ToString("#") + "s");
 }
Exemple #5
0
 private void Start()
 {
     difficulty = PlayerPrefsController.GetMasterDifficulty();
     animator   = GetComponent <Animator>();
     Debug.Log(gameObject.name + " initial damage: " + damage);
     damage *= difficulty;
     Debug.Log(gameObject.name + " difficulty damage: " + damage);
 }
Exemple #6
0
    private void SetHealthForDifficulty()
    {
        Debug.Log(PlayerPrefsController.GetMasterDifficulty());
        int difficultyFactor = (Mathf.RoundToInt(PlayerPrefsController.GetMasterDifficulty() * 5));

        Debug.Log(difficultyFactor);
        playerHealth -= difficultyFactor;
    }
    // Start is called before the first frame update
    IEnumerator Start()
    {
        numberOfSpawns = PlayerPrefsController.GetMasterDifficulty();

        int currentSpawn = 0;

        do
        {
            yield return(StartCoroutine(SpawnEnemy()));

            currentSpawn++;
            if (currentSpawn >= numberOfSpawns)
            {
                spawn = false;
            }
        }while (spawn);
    }
Exemple #8
0
    // Start is called before the first frame update
    void Start()
    {
        volumeOption         = transform.Find("Volume/VolumeSlider").gameObject;
        difficultyOption     = transform.Find("Difficulty/DifficultySlider").gameObject;
        playerPrefController = FindObjectOfType <PlayerPrefsController>();

        //populate with saved player prefs
        float volumePref = playerPrefController.GetMasterVolume();

        if (volumeOption.GetComponent <Slider>().value != volumePref)
        {
            volumeOption.GetComponent <Slider>().value = volumePref;
        }
        float difficultyPref = playerPrefController.GetMasterDifficulty();

        if (difficultyOption.GetComponent <Slider>().value != difficultyPref)
        {
            difficultyOption.GetComponent <Slider>().value = difficultyPref;
        }
    }
Exemple #9
0
    public void GameDifficulty()
    {
        var gameDifficulty = PlayerPrefsController.GetMasterDifficulty();

        Debug.Log("Difficulty set to" + gameDifficulty);

        //Easy Mode
        if (gameDifficulty == 0f)
        {
            damages = 25;
        }
        //Normal Mode
        else if (gameDifficulty == 1f)
        {
            damages = 35;
        }
        //Hard Mode
        else if (gameDifficulty == 2f)
        {
            damages = 50;
        }
    }
Exemple #10
0
    // Start is called before the first frame update
    void Start()
    {
        bool attacker = GetComponent <Attacker>();
        bool defender = GetComponent <Defender>();

        difficulty = PlayerPrefsController.GetMasterDifficulty();

        if (attacker)
        {
            Debug.Log(gameObject.name + " orig health set to: " + fullHealth);
            fullHealth = fullHealth * difficulty;
            Debug.Log(gameObject.name + " diff health set to: " + fullHealth);
        }
        else if (defender)
        {
            Debug.Log(gameObject.name + " orig health set to: " + fullHealth);
            fullHealth = fullHealth / difficulty;
            Debug.Log(gameObject.name + " diff health set to: " + fullHealth);
        }

        currentHealth = fullHealth;
        Debug.Log(gameObject.name + " level health set to: " + currentHealth);
    }
    //difficulty

    public void GameDifficulty()
    {
        var gameDifficulty = PlayerPrefsController.GetMasterDifficulty();

        Debug.Log("Difficulty set to " + gameDifficulty);
        //easy
        if (gameDifficulty == 0f)
        {
            return;
        }
        //normal
        else if (gameDifficulty == 1f)
        {
            health      = 100f;
            HpText.text = health.ToString();
        }
        //hard
        else if (gameDifficulty == 2f)
        {
            health      = 50f;
            HpText.text = health.ToString();
        }
    }
Exemple #12
0
 public void AddCoins(int amount)
 {
     coins += Mathf.CeilToInt(amount / PlayerPrefsController.GetMasterDifficulty());
     UpdateDisplay();
 }
 private void Start()
 {
     playerHealth = baseHealth - PlayerPrefsController.GetMasterDifficulty();
     healthText   = GetComponent <Text>();
     UpdateHealthDisplay();
 }
Exemple #14
0
 // Start is called before the first frame update
 void Start()
 {
     currentHealth = Mathf.Round(maxHealth / PlayerPrefsController.GetMasterDifficulty());
     displayHealth();
 }
 // Start is called before the first frame update
 void Start()
 {
     hearts    -= PlayerPrefsController.GetMasterDifficulty();
     heartsText = GetComponent <Text>();
     UpdateHeartsToDisplay();
 }
 private void Start()
 {
     SetLevelTimer(PlayerPrefsController.GetMasterDifficulty());
     StartCoroutine(StartSpawners());
 }
Exemple #17
0
 private void Start()
 {
     Destroy(gameObject, destroyTime);
     projectileDamage /= PlayerPrefsController.GetMasterDifficulty();
 }
 // Start is called before the first frame update
 void Start()
 {
     volumeSlider.value     = PlayerPrefsController.GetMasterVolume();
     difficultySlider.value = PlayerPrefsController.GetMasterDifficulty();
     musicPlayer            = FindObjectOfType <MusicPlayer>();
 }
Exemple #19
0
 private void Start()
 {
     levelTime = baseTime + PlayerPrefsController.GetMasterDifficulty() * timeIncFactror;
 }
    private void SetForDifficulty()
    {
        int difficultyFactor = Mathf.RoundToInt(PlayerPrefsController.GetMasterDifficulty() * 200);

        stars -= difficultyFactor;
    }
Exemple #21
0
 void Start()
 {
     coins    = Mathf.Round(coins / PlayerPrefsController.GetMasterDifficulty());
     coinText = GetComponent <Text>();
     UpdateDisplay();
 }
Exemple #22
0
 private void Start()
 {
     lives     = baseLives - PlayerPrefsController.GetMasterDifficulty();
     livesText = GetComponent <Text>();
     UpdateDisplay();
 }
 void Start()
 {
     life     = Mathf.RoundToInt(life / PlayerPrefsController.GetMasterDifficulty());
     lifeText = GetComponent <Text>();
     UpdateDisplay();
 }
Exemple #24
0
 void Start()
 {
     score     = Mathf.Round(score / PlayerPrefsController.GetMasterDifficulty());
     scoreText = FindObjectOfType <ScoreBoard>().GetComponent <Text>();
     UpdateScore();
 }