Fast fuckers will run away on taking damage
This commit is contained in:
@@ -6,7 +6,7 @@ public class FastFucker : Ratbot
|
|||||||
bool attack = true;
|
bool attack = true;
|
||||||
void Update() {
|
void Update() {
|
||||||
if (attack)
|
if (attack)
|
||||||
MoveTowardsPlayer(moveSpeed*3);
|
MoveTowardsPlayer(moveSpeed*2);
|
||||||
else
|
else
|
||||||
MoveAwayFromPlayer(moveSpeed);
|
MoveAwayFromPlayer(moveSpeed);
|
||||||
}
|
}
|
||||||
@@ -27,4 +27,8 @@ public class FastFucker : Ratbot
|
|||||||
yield return new WaitForSeconds (1F);
|
yield return new WaitForSeconds (1F);
|
||||||
attack = true;
|
attack = true;
|
||||||
}
|
}
|
||||||
|
new void Damage (float hurtyAmount) {
|
||||||
|
RunAway();
|
||||||
|
base.Damage(hurtyAmount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ public class Ratbot : MonoBehaviour
|
|||||||
|
|
||||||
// Die if health below zero
|
// Die if health below zero
|
||||||
public void Damage(float hurtyAmount) {
|
public void Damage(float hurtyAmount) {
|
||||||
Debug.Log(hurtyAmount);
|
|
||||||
health -= hurtyAmount;
|
health -= hurtyAmount;
|
||||||
if (health <= 0) {
|
if (health <= 0) {
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
|
|||||||
Reference in New Issue
Block a user