title: Java - trying to initialise an object with parameters passed in another constructor, in another class?
body: <p>Very basic java knowledge at the moment, in need of some assistance in trying to create a game of Pacman.</p>
  
  <p>Currently I have three classes, the player class, the dot class and the game class, all interacting to create a basic game of Pacman. </p>
  
  <p>The issue I am having is this:</p>
  
  <p>I need the 'initialX and initialY fields as show below (these will be user inputted coordinates);</p>
  
  <pre><code>public class Player
  {
      private int x, y, collectedDots;
  
      public Player(int initialX, int initialY)
      {
          x = initialX;
          y = initialY;
  
          collectedDots = 0;
      }
  
      public int getX()
      {
          return x;
      }
  
      public int getY()
      {
          return y;
          }
  
  } 
  </code></pre>
  
  <p>to pass through as my parameters within the new 'player' object within the Game Class. </p>
  
  <pre><code>public class Game
  {
  
  
      public Game()
      {
          Player player = new Player();
          Dot dot1 = new Dot();
          Dot dot2 = new Dot();
          Dot dot3 = new Dot();
      }
  
  
  }
  </code></pre>
  
  <p>It has me stumped, and I'm assuming I've either gone about this the wrong way, or I'm completely missing something. </p>