Skip to content

Commit

Permalink
Add direction helper
Browse files Browse the repository at this point in the history
  • Loading branch information
isadorasophia committed Nov 3, 2024
1 parent 05c4cf8 commit d168b08
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Murder/Utilities/DirectionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,10 @@ public static (string name, bool flipped) GetName(int i, int totalDirections, bo
throw new ArgumentException("Unsupported number of directions. Only 2, 4 or 8 are supported.");
}
}

public static void Face(Entity from, Entity to)
{
Direction direction = LookAtEntity(from, to);
from.SetFacing(direction);
}
}

0 comments on commit d168b08

Please sign in to comment.