Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Update() {
  2.     var str : String = "";
  3.    
  4.     if (!hasLost) {
  5.     str = numHits.ToString();
  6.     }
  7.     else {
  8.         str = "Hits:" + numHits.ToString() + "\nYour Best:" + bestScore;
  9.        
  10.         if (bestScore > lastBest) str += "\nNEW RECORD!";
  11.     }
  12.  
  13.    
  14.     hitCount.text = str;
  15.     if (transform.position.y <-3) {
  16.     if (!hasLost) {
  17.         hasLost = true;
  18.         lastBest =bestScore;
  19.         if(numHits > bestScore) {
  20.             bestScore = numHits;
  21.             }
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement