http://www.robocoderepository.com/BotDetail.jsp?id=3636
Not sure for now.
A combination of StopAndGo with additional stuff.
Semi - Linear Targeting
The choice is Yours, StopAndGo or WaveSurfing
No Difference
It does?
GFs being hit by enemy (between rounds).
It is supposed to Surf, so I want it to surf as a Nano Well, Thus AceSurf.
Please Follow the RWCPL
package ary.nano; import robocode.AdvancedRobot; import robocode.HitByBulletEvent; import robocode.HitWallEvent; import robocode.ScannedRobotEvent; import robocode.util.Utils; public class AceSurf extends AdvancedRobot { private static double move = 100, enemyEnergy; private static int[] hit = new int[41]; //hit array to track where I am hit private static int gf = 0; public void run() { // helps targeting accuracy //setAdjustRadarForGunTurn(true); setAdjustGunForRobotTurn(true); turnRadarRightRadians(Double.POSITIVE_INFINITY); //turn Radar } public void onScannedRobot(ScannedRobotEvent e) { double reuse = 10000; //Ultimate variable setTurnRadarLeftRadians(getRadarTurnRemaining()); //Radar Lock //if enemy fired a bullet if (enemyEnergy > (enemyEnergy = e.getEnergy())) { gf = (int)((3*move*Math.random()))/20; //get GF for(int x = 40; x >= 0; x--) //loop through the array if(hit[x] < reuse) reuse = hit[x]; // get least dangerous one if(hit[gf+20] > reuse) move = -move; //if it is more dangerous than it, reverse //out.println(gf); setMaxVelocity(8); ///keep it 8 for consistency setAhead(3*move*Math.random()); //Move with whatever distance you deifned } // turn perpendicular with range control (approx not so close and not so far, I hope) setTurnRightRadians(Math.cos((reuse = e.getBearingRadians()) - 2000/10000)); //semi - linear targeting (from the wiki) setTurnGunRightRadians(Utils.normalRelativeAngle((reuse += getHeadingRadians()) - getGunHeadingRadians() + (e.getVelocity() * Math.sin(e.getHeadingRadians() - reuse) / 16.0))); setFire(2.5); //best firepower } public void onHitByBullet(HitByBulletEvent e){ hit[gf+20]++; //log your gf hits } public void onHitWall(HitWallEvent e) { setAhead(move = -move); //kinda bad, but best so far. } }
better movement
The Neophyte series and Splinter perhaps. I don't have much space for my gun.
The nano linear targeting, modified by me after using it.