diff --git a/Assets/Scripts/GameScript.cs b/Assets/Scripts/GameScript.cs index e3006a5..f005bb3 100644 --- a/Assets/Scripts/GameScript.cs +++ b/Assets/Scripts/GameScript.cs @@ -11,7 +11,10 @@ public class GameScript : MonoBehaviour private bool clickDown = false; private bool clicked = false; + private bool gameOver = false; private int objectsPolished = 0; + private int timeLimit = 60; + private float timer = 0.0f; private GameObject pickedUpItem; // Start is called before the first frame update @@ -29,6 +32,17 @@ public class GameScript : MonoBehaviour { clickDown = true; } + + timer += Time.deltaTime; + float seconds = timeLimit - (timer % 60); + + //Debug.Log((int)seconds); + + if(seconds < 0 && gameOver == false) + { + //Debug.Log(objectsPolished); + gameOver = true; + } }