title: Making a player move to my mouse when clicked?
body: <p>How can I get my player to move to the mouse when it is clicked (like in Warcraft)?</p>
  
  <p>So far I have tried:</p>
  
  <pre><code>if (Mouse.isButtonDown(0)) {
  
      if (X &lt; Mouse.getX()) {
          X += Speed;
      }
      if (X &gt; Mouse.getX()) {
          X -= Speed;
      }
      if (Y &lt; Mouse.getY()) { 
          Y += Speed;
      }
      if (Y &gt; Mouse.getY()) {
          Y -= Speed;
      }
  } 
  </code></pre>
  
  <p>But that only does what I want if I hold the mouse down.</p>