[Home]NanoDeath

Robo Home | Changes | Preferences | AllPages

Showing revision 13
Source for NanoDeath 2.51000

Big update, I get bored easily. It tries not to overshoot the target, so it cuts off less. It only fires when it's close. Big jump in rating.

The gun is kind of bad, it doesn't quite lead the target, and it tries to cut off the target, but doesn't overpersue too much (hopefully). It does well against good bots (because most bots aren't prepared for it) and it does mediocre against bad bots (because it's kind of hard to miss an incoming target).

package amz;
import robocode.*;

public class NanoDeath extends AdvancedRobot
{	
	public void run() 
	{
		setAdjustGunForRobotTurn(true);
		setAdjustRadarForGunTurn(true);
		while(true)
			turnRadarRightRadians(Double.POSITIVE_INFINITY);
	}
	public void onScannedRobot(ScannedRobotEvent e)
	{
		double absBearing;

		setTurnRadarRightRadians(5 * Math.sin((absBearing = e.getBearingRadians() + getHeadingRadians()) - getRadarHeadingRadians()));

		setTurnGunRightRadians(Math.sin(absBearing - getGunHeadingRadians()
			+ Math.asin(Math.sin(e.getHeadingRadians() - absBearing) * e.getVelocity() / 11)));
		
		setTurnRightRadians(Math.tan(absBearing =  absBearing - getHeadingRadians() + Math.asin(Math.sin(e.getHeadingRadians() - absBearing) * e.getVelocity() / 14)));
		
		setAhead(Double.POSITIVE_INFINITY * Math.cos(absBearing));
		
		if((absBearing = e.getEnergy()) > 0 && e.getDistance() < 350)
			setFire((absBearing-1) / 4);
	}
}

So anyone have any comments, suggestions, questions, etc?

Rammers are cool. --David Alves

I can't stop to see how amazing can be the performance of rammers against the top bots... A headache. -- Axe

ha! --andrew

Yep. Rammers are cool. --Axe


Robo Home | Changes | Preferences | AllPages
Edit revision 13 of this page | View other revisions | View current revision
Edited May 24, 2005 2:34 EST by adsl-69-105-112-138.dsl.pltn13.pacbell.net (diff)
Search: