Skip to content
Snippets Groups Projects
Verified Commit 425628dc authored by Adrian Paschkowski's avatar Adrian Paschkowski :thinking:
Browse files

Dead fighters shouldn't face the enemy

parent 91056c63
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,7 @@ public class AntiPlayer : Fighter, IFighterCallback ...@@ -36,7 +36,7 @@ public class AntiPlayer : Fighter, IFighterCallback
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();
if (currentTargetEnemy == null) if (!alive || currentTargetEnemy == null)
{ {
return; return;
} }
......
...@@ -20,10 +20,13 @@ public abstract class Enemy : Fighter ...@@ -20,10 +20,13 @@ public abstract class Enemy : Fighter
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();
// Always face the AntiPlayer if (alive)
var scale = transform.localScale; {
scale.x = transform.position.x < antiPlayer.transform.position.x ? -initalScale.x : initalScale.x; // Always face the AntiPlayer
transform.localScale = scale; var scale = transform.localScale;
scale.x = transform.position.x < antiPlayer.transform.position.x ? -initalScale.x : initalScale.x;
transform.localScale = scale;
}
} }
protected override bool CanAttack() protected override bool CanAttack()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment