Tuesday 30 August 2011

radar

A radar in Robocode can turn a maximum of 45° or π/4rad in a single tick. The radar scans robots up to 1200 units away. The angle that the radar rotates between two ticks creates what is called a radar arc, and every robot detected within the arc is sent to the onScannedRobot() method in order of distance from the scanning bot. The closest bot is detected first, while the furthest bot is detected last. By default, the onScannedRobot() method has the lowest event priority of all the event handlers in Robocode, so it is the last one to be triggered each tick.


For most of these radar locks, you will need to add one of the following to your run() method:
 
setAdjustRadarForRobotTurn(true);
setAdjustGunForRobotTurn(true);
setAdjustRadarForGunTurn(true);
 
 
 
 

No comments:

Post a Comment