Head-On Targeting

From Robowiki
Revision as of 20:40, 9 November 2007 by Voidious (talk | contribs) (New page: == Description == The simple strategy of Targeting where you last saw the enemy. Works surprisingly well against surprisingly many bots, especially in Melee battles. == Example ==...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Description

The simple strategy of Targeting 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()));