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

public class ClickMeLoseScreen : MonoBehaviour {

	float timer;
	SpriteRenderer sr;

	// Use this for initialization
	void Start () {
		sr = this.gameObject.GetComponent<SpriteRenderer> ();
		sr.enabled = false;
	}

	// Update is called once per frame
	void Update () {
		timer += Time.deltaTime;

		if (timer > (6.66f / 2))
		{
			sr.enabled = true;
		}

		if(Input.GetMouseButtonDown(0))
		{
			if(Camera.main.ScreenToWorldPoint (Input.mousePosition).x > -5f && Camera.main.ScreenToWorldPoint(Input.mousePosition).x < 4.8f
				&& Camera.main.ScreenToWorldPoint (Input.mousePosition).y > -9.5f && Camera.main.ScreenToWorldPoint(Input.mousePosition).y < -7.1f)
			{
				SceneManager.LoadScene (1);
			}

		}
	}
}
