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
protected override void Update()
{
base.Update();
if (currentTargetEnemy == null)
if (!alive || currentTargetEnemy == null)
{
return;
}
......
......@@ -20,10 +20,13 @@ public abstract class Enemy : Fighter
protected override void Update()
{
base.Update();
// Always face the AntiPlayer
var scale = transform.localScale;
scale.x = transform.position.x < antiPlayer.transform.position.x ? -initalScale.x : initalScale.x;
transform.localScale = scale;
if (alive)
{
// Always face the AntiPlayer
var scale = transform.localScale;
scale.x = transform.position.x < antiPlayer.transform.position.x ? -initalScale.x : initalScale.x;
transform.localScale = scale;
}
}
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