Exemple #1
0
 public void OnDeath()
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("Highscore") < score)
     {
         PlayerPrefs.SetFloat("Highscore", score);
     }
     PlayerPrefs.SetFloat("CreditTemp", score);
     deathMenu.ToggleDeathMenu(score);
 }
Exemple #2
0
 void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.tag == "Damage")
     {
         health -= 40;
         if (health <= 0)
         {
             death.ToggleDeathMenu();
         }
     }
 }
Exemple #3
0
    public void OnDeath()
    {
        isDead = true;
        if (PlayerPrefs.GetFloat("Highscore" + currentScene.name) < score)
        {
            PlayerPrefs.SetFloat("Highscore" + currentScene.name, score);
        }

        eggsToAdd  = PlayerPrefs.GetInt("NumEggs");
        eggsToAdd += eggs;
        PlayerPrefs.SetInt("NumEggs", eggsToAdd);
        deathMenu.ToggleDeathMenu(score);
    }
Exemple #4
0
    // Update is called once per frame
    void Update()
    {
        if (gm.isDead)
        {
            deathMenu.ToggleDeathMenu();
            return;
        }

        if (gm.score >= scoreToNextLevel)
        {
            LevelUp();
        }

        gm.score  += Time.deltaTime * difficulty;
        score.text = ((int)gm.score).ToString();
        lives.text = "Lives: " + ((int)gm.lives).ToString();
    }
Exemple #5
0
 private void OnDeath()
 {
     isDead = true;
     deathMenu.ToggleDeathMenu(keys);
 }
Exemple #6
0
 private void OnDeath()
 {
     Debug.Log("End Game Here");
     deathMenu.ToggleDeathMenu();
     vehicle.SetActive(false);
 }
Exemple #7
0
 public void OnDeath()
 {
     isDead = true;
     deathMenu.ToggleDeathMenu(score);
 }