Head-On Targeting

From Robowiki
Revision as of 07:08, 1 July 2010 by Chase-san (talk | contribs) (use <syntaxhighlight>)
Jump to navigation Jump to search
Youtube
Youtube has a video of Head-On Targeting in action: click here to watch
This article is a stub. You can help RoboWiki by expanding it.

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