Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     if ((Time.time - newTime) > elapsedTime)
     {
         dropMissile(speed);
         newTime = Time.time;
     }
     if (Time.time - startTime >= 19f && !upDifficulty)
     {
         upDifficulty = true; //After 15 seconds start spawning fast missiles
     }
     if ((Time.time - startTime) > spawnFastTime && SceneManager.GetActiveScene().name ==
         "MainScene" && upDifficulty)
     {
         dropMissile(speed * 2 - 2f);
         if (elapsedTime >= 1f)
         {
             elapsedTime = elapsedTime - .1f;
         }
         startTime = Time.time;
     }
     if (SceneManager.GetActiveScene().name == "MainScene")
     {
         text.text = GlobalControl.getPoints().ToString();
     }
 }
Exemple #2
0
 // Update is called once per frame
 void Update()
 {
     if (add_miss >= 3 && !(Time.fixedTime >= (wait + .75)))
     {
         counter++;
     }
     else if (add_miss >= 3 && (Time.fixedTime >= (wait + .75)))
     {
         SceneManager.LoadScene("EndScreen");
     }
     else if (GlobalControl.getPoints() == 200 && (Time.fixedTime >= (wait + .75)))
     {
         SceneManager.LoadScene("WinnerScene");
     }
     else
     {
         wait = Time.fixedTime;
     }
     if (started)
     {
         if (time == -1f)
         {
             time = Time.time;
         }
         if (Time.time - time >= elapsedTime)
         {
             gameObject.GetComponent <CameraShake>().enabled = false;
             time    = -1f;
             started = false;
         }
     }
 }
Exemple #3
0
 // Use this for initialization
 void Start()
 {
     points    = GlobalControl.getPoints();
     text.text = points.ToString();
 }