Advertisement
Guest User

CornersSmartFire

a guest
May 27th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1.     /**
  2.      * smartFire:  Custom fire method that determines firepower based on distance.
  3.      *
  4.      * @param robotDistance the distance to the robot to fire at
  5.      */
  6.     public void smartFire(double robotDistance) {
  7.         if (robotDistance > 200 || getEnergy() < 15) {
  8.             fire(1);
  9.         } else if (robotDistance > 50) {
  10.             fire(2);
  11.         } else {
  12.             fire(3);
  13.         }
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement