mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-04 19:15:54 +00:00
Added reaction time to enemies
This commit is contained in:
parent
1c4897f054
commit
543f5f0d6b
11 changed files with 63 additions and 31 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue