Robot IsAdjustRadarForRobotTurn Property Robocode Robot API for .NET
Sets the radar to turn independent from the robot's turn.

Ok, so this needs some explanation: The radar is mounted on the gun, and the gun is mounted on the robot's body. So, normally, if the robot turns 90 degrees to the right, the gun turns, as does the radar. Hence, if the robot turns 90 degrees to the right, then the gun and radar will turn with it as the radar is mounted on top of the gun. To compensate for this, you can call IsAdjustRadarForRobotTurn = true. When this is set, the radar will turn independent from the robot's turn, i.e. the radar will compensate for the robot's turn.

Note: This method is additive until you reach the maximum the radar can turn. The "adjust" is added to the amount you set for turning the robot, then capped by the physics of the game. If you turn infinite, then the adjust is ignored (and hence overridden).

Examples

Assuming the robot, gun, and radar all start Out facing up (0 degrees):
// Set radar to turn with the robots's turn
SetAdjustRadarForRobotTurn(false); // This is the default
TurnRight(90);
// At this point, the body, gun, and radar are all facing right (90 degrees);
// Set radar to turn independent from the robot's turn
SetAdjustRadarForRobotTurn(true);
TurnRight(90);
// At this point, the robot and gun are facing right (90 degrees), but the radar is still facing up.
-- or --

Namespace: Robocode
Assembly: robocode (in robocode.dll) Version: 1.9.3.0
Syntax

public bool IsAdjustRadarForRobotTurn { get; set; }

Property Value

Type: OnlineBoolean
See Also