Added reaction time to enemies

This commit is contained in:
Marco 2025-03-25 15:15:04 +01:00
commit 543f5f0d6b
11 changed files with 63 additions and 31 deletions

View file

@ -25,7 +25,7 @@ public partial class NavigationMovementModule : Node2D
_lastTargetPosition = target;
}
public void Move()
public void Move(float movementSpeed)
{
if (!_lastTargetPosition.HasValue)
{
@ -43,7 +43,7 @@ public partial class NavigationMovementModule : Node2D
var nextPathPosition = _navigationAgent.GetNextPathPosition();
var newVelocity = currentAgentPosition.DirectionTo(nextPathPosition) * StorageModule.MovementSpeed;
var newVelocity = currentAgentPosition.DirectionTo(nextPathPosition) * movementSpeed;
if (_navigationAgent.AvoidanceEnabled)
{