Difference between revisions of "Module/Targeting/HeadOnTargeting"
Jump to navigation
Jump to search
(Module Targeting: HeadOnTargeting) |
RednaxelaBot (talk | contribs) m (Using <syntaxhighlight>.) |
||
Line 1: | Line 1: | ||
− | < | + | <syntaxhighlight> |
package jab.targeting; | package jab.targeting; | ||
Line 16: | Line 16: | ||
} | } | ||
} | } | ||
− | </ | + | </syntaxhighlight> |
Latest revision as of 09:29, 1 July 2010
package jab.targeting;
import jab.Module;
import jab.Targeting;
public class HeadOnTargeting extends Targeting {
public HeadOnTargeting(Module bot) {
super(bot);
}
public void target() {
double absoluteBearing = bot.getHeadingRadians() + bot.enemy.bearingRadians;
bot.setTurnGunRightRadians(robocode.util.Utils.normalRelativeAngle(absoluteBearing -bot.getGunHeadingRadians()));
}
}