using UnityEngine;
using System.Collections;



public class global_variables : MonoBehaviour {

	public bool canJump;
	public bool movingUp;
	public bool rockFire;
	public bool arrowFire;
	public float playerX;
	public float playerY;
	public int playerHealth;

	public int dialoguePosition;

	public bool InCutscene;

	public Vector2 projection;
	public int rock_damage;

	private GameObject player;

	public Vector2 arrowProjection;

	// Use this for initialization
	void Start () {
		rock_damage=1;
		rockFire = false;
		player = GameObject.FindGameObjectWithTag ("Player").gameObject;
	}
	
	// Update is called once per frame
	void Update () {
				if (playerHealth < 1) {
						InvokeRepeating ("DeathFall", 0, (float)0.1);
						Invoke ("ReloadLevel",(float)1);
				}
				if (dialoguePosition == 6) {
						Invoke ("ReloadLevel", (float)2);
				}
		}


	void DeathFall(){
				player.transform.Rotate (0, 0, 2);
		}


	void ReloadLevel(){
				Application.LoadLevel (Application.loadedLevel);
		}
}
