#pragma strict
var speed:int;
var playerController:MouseController;
var bomb:AudioClip;
var throwSound:AudioClip;

function Start () {
	audio.PlayOneShot(throwSound);
	
	speed = 200;
}

function Update () {
	//transform.Rotate(Vector3.up*speed*Time.deltaTime);
}

function OnBecameInvisible(){
	Destroy(this.gameObject);
}

function OnTriggerEnter(hitObject:Collider){
	if(hitObject.gameObject.tag == "Line" || hitObject.gameObject.tag == "LineLeft" || hitObject.gameObject.tag == "LineRight"){
		Debug.Log("Player Hit Bomb");
		Destroy(this.gameObject);
	}else if(hitObject.gameObject.tag == "Player"){
		if(MainMenu2Controller.levelSelected == "Classic"){
			Application.LoadLevel(3);
		}else{
			audio.PlayOneShot(bomb);
			yield WaitForSeconds(1);
			Destroy(this.gameObject);
			if(MainMenu2Controller.levelSelected == "Arcade"){
				MouseController.score = 0; 
			}
			else if(MainMenu2Controller.levelSelected == "Ninja"){
				MouseController.score -= 10; 
			}
		}
	}
}