Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import robocode.util.Utils;
  2.  
  3. public void run() {
  4. turnRadarRightRadians(Double.POSITIVE_INFINITY);
  5. do {
  6. scan();
  7. } while (true);
  8. }
  9.  
  10. public void onScannedRobot(ScannedRobotEvent e) {
  11. double radarTurn = getHeadingRadians() + e.getBearingRadians() - getRadarHeadingRadians();
  12. setTurnRadarRightRadians(Utils.normalRelativeAngle(radarTurn));
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement