it's michael, what's michael

This commit is contained in:
2024-09-15 02:17:40 -07:00
parent 096bcd6168
commit 7680ab8b45
313 changed files with 6913 additions and 1760 deletions

View File

@@ -18,16 +18,13 @@ public partial class EnemyLogic
public Transition On(in Input.PhysicsTick input)
{
var delta = input.Delta;
var gameRepo = Get<IGameRepo>();
var enemy = Get<IEnemy>();
var targetPosition = enemy.NavAgent.GetNextPathPosition();
var nextPosition = enemy.NavAgent.GetNextPathPosition();
var lookAtPos = enemy.NavAgent.GetNextPathPosition();
enemy.Velocity = (targetPosition - enemy.GlobalTransform.Origin).Normalized() * 3.0f;
enemy.Rotation = new Vector3(0, (float)Mathf.LerpAngle(enemy.Rotation.Y, Mathf.Atan2(enemy.Velocity.X, enemy.Velocity.Z), delta * 10.0), 0);
var direction = enemy.NavAgent.GetNextPathPosition() - enemy.GlobalPosition;
enemy.Velocity = enemy.Velocity.MoveToward(direction.Normalized() * 0.01f, (float)delta);
Output(new Output.MovementComputed(enemy.Velocity));
Output(new Output.MovementComputed());
return ToSelf();
}
@@ -35,7 +32,6 @@ public partial class EnemyLogic
{
var enemy = Get<IEnemy>();
enemy.NavAgent.TargetPosition = input.PatrolTarget;
enemy.LookAt(new Vector3(input.PatrolTarget.X, enemy.GlobalPosition.Y, input.PatrolTarget.Z), Vector3.Up);
return ToSelf();
}
}