#pragma strict
// Public variable 
public var speed : int = 6;
public var Shotdelay : int = 0.1;
public var Damage :int = 1;
public var isfriendly : int = 1;

// Gets called once when the bullet is created
function Start () {  
    // Set the x velocity to make the bullet move sideways
    GetComponent.<Rigidbody2D>().velocity.x = speed;
   }

function OnTriggerEnter2D(obj: Collider2D)
{
GameObject.Destroy(gameObject);
}

// Gets called when the object goes out of the screen
function OnBecameInvisible() {  
    // Destroy the bullet 
    GameObject.Destroy(gameObject);
}