Difference between revisions of "Head-On Targeting"
Jump to navigation
Jump to search
BeastBots101 (talk | contribs) |
BeastBots101 (talk | contribs) |
||
Line 2: | Line 2: | ||
{{stub}} | {{stub}} | ||
− | The simple strategy of aiming where you last saw the enemy. Works surprisingly well against surprisingly many bots | + | The simple strategy of aiming where you last saw the enemy. Works surprisingly well against surprisingly many bots (Mainly against Oscillator Movement and sometimes random movement). It also works especially well in [[Melee]] battles. [[HawkOnFire]] and [[Shiz]] both use it. |
== Examples == | == Examples == |
Revision as of 03:28, 28 September 2013
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 (Mainly against Oscillator Movement and sometimes random movement). It also works especially well in Melee battles. HawkOnFire and Shiz both use it.
Examples
In onScannedRobot
, add:
double absoluteBearing = getHeadingRadians() + e.getBearingRadians();
setTurnGunRightRadians(
robocode.util.Utils.normalRelativeAngle(absoluteBearing -
getGunHeadingRadians()));
A code like this was found in sample.Fire
.
double turnGunAmt = (getHeadingRadians() + e.getBearingRadians()) - getGunHeadingRadians();
//You can make this setTurnGunRight(...) or setTurnGunRightRadians(...) with an AdvancedRobot
turnGunRight(turnGunAmt);
See also
|