package fi; import robocode.*; import baseRobot.*; import java.awt.Color; /** * exBaseRobo - a robot by (your name here) */ public class exBaseRobo extends BaseRobot { /** * 色の設定 */ public void setMyColor() { setColors(Color.red, Color.red, Color.red); } /** * エンジン設定. ノンブロッキング処理推奨 */ public void setEngine(int count) { setAhead(100); if (count%3==0) setTurnRight(100); } /** * 索敵中に敵を発見した場合,この関数が呼び出される.ブロッキング処理推奨 */ public void attackScanEnemyFind(ScannedRobotEvent e) { turnRadarRight(0); // レーダ停止 turnGunRight(RoboTool.getRelAngle(enemyAngle, getGunHeading())); // 砲塔旋回 fire(3); // 発射 } /** * 勝利時パフォーマンス */ public void onWin(WinEvent e) { ahead(0); setTurnGunLeft(RoboConst.faraway); waitFor(new GunTurnCompleteCondition(this)); } }