Module/Targeting/HeadOnTargeting

From Robowiki
< Module‎ | Targeting
Revision as of 09:29, 1 July 2010 by RednaxelaBot (talk | contribs) (Using <syntaxhighlight>.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
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()));
	}
}