RoboRumble Gun Challenge/RaikoNMT

From Robowiki
Jump to navigation Jump to search

Raiko movement without the Musashi Trick applied. For use in the RR Gun Challenge.

Download BeeRRGC to get the source code and see it in use: http://www.robocoderepository.com/BotDetail.jsp?id=2310

package wiki.rrgc;
import pez.rumble.pgun.*;
import wiki.rmove.*;
import robocode.*;
import robocode.util.Utils;
import java.awt.Color;
	
// BeeRRGC - Bee gun by PEZ - Raiko Movement by Jamougha
// For the RoboRumble Gun Challenge - http://robowiki.net/?RRGunChallange
//
// Released under the RWPCL - RoboWiki Public Code Licence - http://robowiki.net/?RWPCL

public class BeeRRGC extends AdvancedRobot {
    Bee gun;
    RaikoNMT movement;

    public void run() {
	gun = new Bee(this);
	movement = new RaikoNMT(this);
        setColors(Color.magenta, Color.magenta, Color.magenta);
        setAdjustGunForRobotTurn(true);
        setAdjustRadarForGunTurn(true);
        do {
            turnRadarRightRadians(Double.POSITIVE_INFINITY); 
        } while (true);
    }

    public void onScannedRobot(ScannedRobotEvent e) {
	gun.onScannedRobot(e);
	movement.onScannedRobot(e);
	setTurnRadarRightRadians(Utils.normalRelativeAngle(getHeadingRadians() 
            + e.getBearingRadians() - getRadarHeadingRadians()) * 2);
    }
}