In onScannedRobot
, add:
double absoluteBearing = getHeadingRadians() + e.getBearingRadians(); setTurnGunRightRadians(robocode.util.Utils.normalRelativeAngle(absoluteBearing - getGunHeadingRadians());
Please post bots on robocode rumble that use head on targeting in HeadOnTargetingBots? --andrew