public string HandleState(Actor actor) { var(detectado, point) = _detector.DetectPlayer(); if (!detectado) { return(nameof(Mover)); } actor.MoveTo(point); return(StateToHandle); }
public string HandleState(Actor actor) { var(detectado, _) = _detector.DetectPlayer(); if (detectado) { GD.Print("Cambio estado"); return(nameof(Perseguir)); } if (_CurrentWayPoint != null && _CurrentWayPoint.DistanceTo(actor) <= 30) { _CurrentWayPoint = _CurrentWayPoint.NextWayPoint(_WayPoints); } GD.Print(actor.Position.DistanceTo(_CurrentWayPoint.Position)); actor.MoveTo(_CurrentWayPoint); return(StateToHandle); }