using UnityEngine;
using System.Collections;

public class Escape : MonoBehaviour {

    private GameObject player;

    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");
    }	
	// Update is called once per frame
	void Update () {
	if (Vector3.Distance(transform.position, player.transform.position)<2 && Input.GetKeyDown(KeyCode.E))
        {
            //call win
            Debug.Log("WIN");
			Application.LoadLevel (2);
        }
	}
}
