Difference between revisions of "RoboRumble Gun Challenge/RaikoNMT"

From Robowiki
Jump to navigation Jump to search
m (Using <syntaxhighlight>.)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 +
{{Navbox small
 +
| parent        = RoboRumble Gun Challenge
 +
| title          = RoboRumble Gun Challenge Sub-pages
 +
| page1          = Results
 +
| page2          = RaikoNMT
 +
| page3          = Archived Talk 20090505
 +
}}
 +
----
 
[[Raiko]] movement without the [[Musashi Trick]] applied. For use in the [[RR Gun Challenge]].
 
[[Raiko]] movement without the [[Musashi Trick]] applied. For use in the [[RR Gun Challenge]].
  
Line 4: Line 12:
 
http://www.robocoderepository.com/BotDetail.jsp?id=2310
 
http://www.robocoderepository.com/BotDetail.jsp?id=2310
  
<pre>
+
<syntaxhighlight>
 
package wiki.rrgc;
 
package wiki.rrgc;
 
import pez.rumble.pgun.*;
 
import pez.rumble.pgun.*;
Line 39: Line 47:
 
     }
 
     }
 
}
 
}
</pre>
+
</syntaxhighlight>
  
 
[[Category:Movement Implementations]]
 
[[Category:Movement Implementations]]

Latest revision as of 09:30, 1 July 2010

RoboRumble Gun Challenge Sub-pages:
RoboRumble Gun ChallengeResults - RaikoNMT - Archived Talk 20090505

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);
    }
}