Ejemplo n.º 1
0
 private void endBossLevel()
 {
     TimeTracker.stopTime();
     TimeTracker.saveFinalTime();
     PlayerPrefs.SetInt("score", ScoreTracker.getScore());
     PlayerPrefs.SetInt("lives", LifeTracker.getLives());
     PlayerPrefs.SetString("NextLevel", "End");
     SceneManager.LoadScene("LevelComplete");
 }
Ejemplo n.º 2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.GetComponent <Player> () == null)
     {
         return;
     }
     TimeTracker.stopTime();
     TimeTracker.saveFinalTime();
     PlayerPrefs.SetInt("score", ScoreTracker.getScore());
     PlayerPrefs.SetInt("lives", LifeTracker.getLives());
     PlayerPrefs.SetInt("Level2Unlocked", 1);
     PlayerPrefs.SetString("NextLevel", "Level 2");
     SceneManager.LoadScene("LevelComplete");
 }
Ejemplo n.º 3
0
 void LateUpdate()
 {
     //Change scene to "end" if final boss is killed
     if (scene.name == "Boss Fight" && !endingBossLevel)
     {
         if (boss.GetComponent <Boss> ().GetIsDead())
         {
             endingBossLevel = true;
             Invoke("endBossLevel", 3);
         }
     }
     //stop time if game is over
     if (player.GetIsDead() && LifeTracker.getLives() - 1 <= 0)
     {
         TimeTracker.stopTime();
     }
 }