Head-On Targeting

From Robowiki
Revision as of 21:37, 14 November 2007 by Voidious (talk | contribs) (adding "Musashi Trick" to "See also", it's specific to HOT)
Jump to navigation Jump to search

The simple strategy of aiming where you last saw the enemy. Works surprisingly well against surprisingly many bots, especially in Melee battles.

Example

In onScannedRobot, add:

double absoluteBearing = getHeadingRadians() + e.getBearingRadians();
setTurnGunRightRadians(
    robocode.util.Utils.normalRelativeAngle(absoluteBearing - 
        getGunHeadingRadians()));

See also