コード例 #1
0
ファイル: SpinBot.java プロジェクト: jaros/robocode
 /**
  * onHitRobot: If it's our fault, we'll stop turning and moving, so we need to turn again to keep
  * spinning.
  */
 public void onHitRobot(HitRobotEvent e) {
   if (e.getBearing() > -10 && e.getBearing() < 10) {
     fire(3);
   }
   if (e.isMyFault()) {
     turnRight(10);
   }
 }
コード例 #2
0
 @Override
 public void onHitRobot(HitRobotEvent event) {
   if (event.isMyFault()) {
     reverseDirection();
   }
 }