using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

/* TO DO LIST 
 * 
* Finish screen
* Licznik czasu rundy
* "Fancy" grafika

*/

public class GameControlScriptLVL1 : MonoBehaviour {

	public int lvl = 1;
	private float time = 0;
	private bool isRunning = false;
	private bool isFinished = false;

	// Use this for initialization
	void Start () {
		isRunning = true;
		isFinished = false;
	}
	
	// Update is called once per frame
	void Update () {
		if(isRunning)
			time += Time.deltaTime;
	}

	public void FinishedLevel()
	{
		isRunning = false;
		isFinished = true;
		lvl = lvl + 1;
		//SceneManager.LoadScene (lvl);
	}

	void OnGUI()
	{
		if(isFinished)
		{
			GUI.Box(new Rect(Screen.width / 2 - 65, 185, 130, 40), "Your Time Was");
			GUI.Label(new Rect(Screen.width / 2 - 10, 200, 20, 30), ((int)time).ToString());
		}
		else if(isRunning)
		{
			GUI.Box(new Rect(Screen.width / 2 - 65, Screen.height - 115, 130, 40), "Your Time Is");
			GUI.Label(new Rect(Screen.width / 2 - 10, Screen.height - 100, 20, 30), ((int)time).ToString());
		}
	}
}
