Difference between revisions of "Head-On Targeting"

From Robowiki
Jump to navigation Jump to search
(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 ==...)
 
(description of HeadOnTargeting, example)
Line 1: Line 1:
 +
[[Category:Targeting]]
 +
 
== Description ==
 
== Description ==
The simple strategy of [[Targeting]] where you last saw the enemy. Works surprisingly well against surprisingly many bots, especially in [[Melee]] battles.
+
The simple strategy of aiming where you last saw the enemy. Works surprisingly well against surprisingly many bots, especially in [[Melee]] battles.
  
 
== Example ==
 
== Example ==

Revision as of 20:41, 9 November 2007


Description

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()));