public bool CheckComplete(Vector2f currentPosition) { if (MathsHelper.LineToPointDistance2D(LastWaypoint, currentPosition) < WaypointTolerance) { return(false); } return(true); }
public void Update(Vector2f currentPosition) { if (MathsHelper.LineToPointDistance2D(CurrentWaypoint, currentPosition) < WaypointTolerance) { SetNextWaypoint(); } // Check that we have completed a full lap if (CheckpointsPassed >= TrackCheckpoints && currentPosition.Magnitude(startPosition) < WaypointTolerance) { CheckpointsPassed = 0; LapsCompleted++; } }