public override ReturnStatus Tick() { if (board.ScannedRobot == null || board.ScannedRobot.Distance > 300) { return(ReturnStatus.Failure); } if (Math.Abs(board.GunBearingAngle()) > 5) { return(ReturnStatus.Failure); } else { board.Robot.SetAllColors(System.Drawing.Color.Orange); board.Robot.Fire(3); return(ReturnStatus.Success); } }
public override ReturnStatus Tick() { if (board.ScannedRobot == null && board.ScannedRobot.Distance > 100) { return(ReturnStatus.Failure); } if (Math.Abs(board.GunBearingAngle()) > 5 && !isRotating) { board.SetRobotColor(System.Drawing.Color.DarkRed); isRotating = true; board.Robot.TurnRadarRight(board.RadarBearingAngle()); board.Robot.TurnRight(board.ScannedRobot.Bearing); return(ReturnStatus.Running); } else { isRotating = false; return(ReturnStatus.Success); } }