public void onScannedRobot(ScannedRobotEvent e) {
double angleToE = getHeading()+e.getBearing();
double radarTurn = Utils.normalRelativeAngleDegrees(angleToE - getRadarHeading());
setTurnRadarRight(2*radarTurn);
setTurnGunRight(2*radarTurn);
if(e.getDistance()<100){
if(getEnergy()>50) fire(3);
else fire(2);
}
else fire(1);
}
雷达工作正常,但即使我将枪旋转到与雷达相同的角度,它也只是随机射击。