[Home]Carruthers/RRGC

Robo Home | Carruthers | Changes | Preferences | AllPages

Carruthers 1.2's VirtualGun? array on top of Raiko, with added PowerManagement?.

Download: http://www.robocoderepository.com/BotDetail.jsp?id=3136

Source: (Depencancy's source also included in package)

package wiki.rrgc;
import robocode.*;
import techdude.core.*;
import java.util.*;
import java.awt.Color;
public class CarruthersRRGC extends techdude.Carruthers {
	static wiki.rmove.RaikoNMT movementRakio;
	public void initCore(){ //Override initCore for initilization of RaikoMove
		if (getRoundNum()==0){movementRakio=new wiki.rmove.RaikoNMT(this);}
		super.initCore();
	}
	public void doStuff(){ //Override doStuff to not do blackboard movement, and added basic power management.
		//moveUsing(motor.doMove(me, enemy, getMovementState()));
		if (getGunHeat()/getGunCoolingRate() < 3){
			setTurnGunRightRadians(Joel.normalizeRelativeAngle(me.guns.targetGun(me, enemy) - getGunHeadingRadians()));
		} else {
			setTurnGunRightRadians(Joel.normalizeRelativeAngle(me.tracker.absoluteAngleTo(enemy.tracker) - getGunHeadingRadians()));
		}
		me.guns.BULLET_POWER = Math.min(Math.max(0.0, (getEnergy()-10.0)*4.0/90.0), 3.0);
		//Fire Bullet
		if (radarmode == 1 /*&& opt_shootgun*/ && setFireBullet(me.guns.BULLET_POWER) != null) {
			//java.awt.Color $1, techdude.core.Joel$Point $2, long $3, float $4, techdude.core.RobotData $5, techdude.core.RobotData $6, java.util.Vector $7
			me.waves.registerWave(new Ocean.Record(Color.GREEN, me.prevLoc, getTime()-1, (float)Joel.bulletVelocity(me.guns.BULLET_POWER), enemy, me, new Vector()), true);
		}
		doRadar();
	}
	//Override onScannedRobot to pass parameters to RaikoMove
	public void onScannedRobot(ScannedRobotEvent e) {
		super.onScannedRobot(e);
		movementRakio.onScannedRobot(e);
	}
}

Results:


Robo Home | Carruthers | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited January 17, 2007 1:34 EST by Nfwu (diff)
Search: