using UnityEngine;
using System.Collections;

public class GameOver : MonoBehaviour {

	public GUIText scoreText;
	
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		if(Input.GetKeyDown(KeyCode.Return) || Input.GetButtonDown("Green")){
			Application.LoadLevel("Game");
		}
		
		//Close the game
		if(Input.GetKeyDown (KeyCode.Escape)){
			Application.Quit ();
		}

		//Show score at the end
		scoreText.text = "Score: " + GameObject.Find ("Score").GetComponent<PassScore>().score;
	}

	//When clicking on the play button
	void OnMouseDown(){
		Application.LoadLevel("Game");
	}
}
