protected override void Attack()
{
//base.Attack ();
if (isJump ()) return; //prevents enemy from moving when he should be jumping
if (isDash ()) return;
if (!airBlasted && distToPlayer > stopAndShootRange) {
if (transform.position.x < Player.transform.position.x) {
GetComponent<Rigidbody2D> ().velocity = new Vector2 (EnemySpeed, GetComponent<Rigidbody2D> ().velocity.y);
} else {
GetComponent<Rigidbody2D> ().velocity = new Vector2 (-EnemySpeed, GetComponent<Rigidbody2D> ().velocity.y);
}
} else {
GetComponent<Rigidbody2D> ().velocity = new Vector2(0, GetComponent<Rigidbody2D> ().velocity.y);
}
if(gun != null){ //shoot the correct gun type
gun.isShooting(true);
} else if(shotgun != null) {
shotgun.isShooting(true);
} else if(launcher != null) {
launcher.isShooting(true);
} else if(lobber != null) {
lobber.isShooting(true);
}
}