title: Java Tank game, creating the fire method
body: <p>I am writing a program that pits two tanks against each other. I have written all the methods except the fire that would end the game. So far</p>
  
  <pre><code>public class Tank {
      Tank() {
          int xPos, yPos;
          char direction;
          boolean loaded = 0;
      }
  
      public void move(Tank currentPlayer) {
          if (yPos&lt;=4 &amp;&amp; yPos&gt;=0) {
              if (xPos&lt;=4 &amp;&amp; xPos&gt;=0) {
                  if (currentPlayer.direction == 'u') {
                      currentPlayer.yPos--;
                  }
                  if (currentPlayer.direction == 'd') {
                      currentPlayer.yPos++;
                  }
                  if (currentPlayer.direction == 'l') {
                      currentPlayer.xPos--;
                  }
                  if (currentPlayer.direction == 'r') {
                      currentPlayer.xPos++;
                  }
              }
          }
      }
  
      public void turn(boolean bool, Tank currentPlayer) {
          if (currentPlayer.direction == 'u') {
              currentPlayer.direction ='r';
          }
          if (currentPlayer.direction == 'd') {
              currentPlayer.direction = 'l';
          }
          if (currentPlayer.direction == 'l') {
              currentPlayer.direction ='u';
          }
          if (currentPlayer.direction == 'r') {
              currentPlayer.direction ='d';
          }
      }
  
      public void load(Tank currentPlayer) {
          currentPlayer.loaded=true;
      }
  
      public int fire(Tank currentPlayer, Tank jim) {
          // ???
      }    
  }
  </code></pre>
  
  <p>How do I go about finishing my program? Any help would be appreciated.</p>