alot of stuff i forgot to commit
This commit is contained in:
parent
fc2329a873
commit
b8d516e734
60 changed files with 7397 additions and 64 deletions
|
|
@ -3,11 +3,12 @@ using UnityEngine;
|
|||
|
||||
public class Enemy : AutoControlledEntity
|
||||
{
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
Vector2 direction = new Vector2(0, stats.rb.linearVelocityY);
|
||||
if (!stats.isStalled)
|
||||
{
|
||||
Vector2 direction = new Vector2(0, stats.rb.linearVelocityY);
|
||||
if (closestEntity && Vector3.Distance(closestEntity.transform.position, transform.position) < maxTargettingRange)
|
||||
{
|
||||
direction.x = (closestEntity.transform.position - transform.position).normalized.x * stats.speed;
|
||||
|
|
@ -17,8 +18,12 @@ public class Enemy : AutoControlledEntity
|
|||
}
|
||||
}
|
||||
FlipSprite(direction);
|
||||
stats.rb.linearVelocity = direction;
|
||||
}
|
||||
else
|
||||
{
|
||||
direction.x = 0;
|
||||
}
|
||||
stats.rb.linearVelocity = direction;
|
||||
}
|
||||
|
||||
public override void OnDeath()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue