Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * smartFire: Custom fire method that determines firepower based on distance.
- *
- * @param robotDistance the distance to the robot to fire at
- */
- public void smartFire(double robotDistance) {
- if (robotDistance > 200 || getEnergy() < 15) {
- fire(1);
- } else if (robotDistance > 50) {
- fire(2);
- } else {
- fire(3);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement