using UnityEngine;
using System.Collections;

public class EnemyBullet : MonoBehaviour 
{
	public Vector2 velocity = new Vector2(0, -4);
	public float lifetime = 2f;
	
	
	void Start()
	{
		rigidbody2D.velocity = velocity;
	}
	
	void Update()
	{
		Destroy(gameObject, lifetime);
	}
	
	void OnTriggerEnter2D(Collider2D other)
	{
		if(other.tag=="Player")
		{
			Destroy(gameObject);
		}
	}
}
