using UnityEngine;
using System.Collections;

public class GUIScript: MonoBehaviour {


	static int score = 0;
	static bool dead = false;
	static public void AddScore(int add){
		if(!dead)
			score+= add;
	}
	static public void Die(){
		dead = true;
		Destroy(killMe2);
	}
	public Texture blackk;
	
	public AudioListener killMe;
	static public AudioListener killMe2;
	
	void Start(){
		killMe2 = killMe;
	}
	
	void OnGUI() {
		if(!dead){
			GUI.Label (new Rect (10, 10, 100, 20), ("score:" + score));
		}else{
			GUI.Label (new Rect (-50, -50, blackk.width, blackk.height), blackk);
			GUI.Label (new Rect (325, 280, 100, 20), ("final score:" + score));
		}
	}
}
