0

I am fairly new to robocode and as I was compiling I kept running into errors with the set and get. I was following a tutorial and it worked great in the tutorial however its not working on my PC

        public void run() {
                setAdjustGunForRobotTurn(true);
                setAdjustRadarForGunTurn(true);
                turnRadarRightRadians(Double.POSITIVE_INFINITY);
        }

        public void onScannedRobot(ScannedRobotEvent e) {
                double radarTurn = getHeadingRadians() + e.getBearingRadians() - getRadarHeadingRadians();      
                setTurnRadarRightRadians(Utils.normalRelativeAngle(radarTurn)); 
        }

The errors gotten from the above code is:(Bold letters are where the pointer was pointing)

1: cannot find the symbol turnRadarRightRadians(Double.POSITIVE_INFINITY);

symbol: method turnRadarRightRadians(double)

2: cannot find symbol double radarTurn = getHeadingRadians() + e.getBearingRadians() - getRadarHeadingRadians();

symbol: method getHeadingRadians()

3: cannot find symbol double radarTurn = getHeadingRadians() + e.getBearingRadians() - getRadarHeadingRadians();

symbol: method getRadarHeadingRadians()

4: error: cannot find symbol setTurnRadarRightRadians(Utils.normalRelativeAngle(radarTurn));

symbol: method setTurnRadarRightRadians(double)

Progman
  • 16,827
  • 6
  • 33
  • 48
IPCZ
  • 21
  • 5

1 Answers1

1

I found the issue was that I was still using the basic robot. My robot(object) was extending robot and the set and get are available only in the AdvancedRobot. Changing it to extend AdvancedRobot and importing robocode.AdvancedRobot; enabled it to work

IPCZ
  • 21
  • 5