Added survival mechanic that consumes inventory items if needed.
This commit is contained in:
@@ -24,7 +24,9 @@ public class MoveNode : ProgramNode
|
||||
Vector3 target = pathPoints[0] - startPosition;
|
||||
float distance = target.Length();
|
||||
|
||||
if (distance < 0.1f)
|
||||
float movementSpeed = robot.GetMovementSpeed();
|
||||
|
||||
if (distance < 0.1f * Mathf.Sqrt(movementSpeed))
|
||||
{
|
||||
robot.Position = pathPoints[0];
|
||||
Vector3I mapIndex = Pathfinding.GetClosestStartPoint(robot.Position);
|
||||
@@ -51,7 +53,7 @@ public class MoveNode : ProgramNode
|
||||
{
|
||||
robot.LookAt(robot.GlobalPosition + lookDirection, Vector3.Up);
|
||||
}
|
||||
robot.GlobalPosition += direction * (float)delta * GameData.robotSpeed;
|
||||
robot.GlobalPosition += direction * (float)delta * movementSpeed;
|
||||
|
||||
return NodeResult.RUNNING;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user