Check if object coordinates meets requirements
<p>I am making game, where I need to check if object`s coordinates meets requirements (Destination coordinates) with permitted +- difference.</p>

<p>Example: </p>

<pre><code>int x; //current object X coordinate
int y; //current object Y coordinate

int destinationX = 50; //example X destination  value
int destinationY = 0;  //example Y destination value
int permittedDiference = 5;

boolean xCorrect = false;
boolean yCorrect = false;
</code></pre>

<p>I am trying to create algorithm, checking</p>

<pre><code> if (x == destinationX + permittedDifference || x == destinationX - permittedDifference)
 {
     xCorrect = true;
 }

 if (y == destinationY + permittedDifference || y == destinationY - permittedDifference)
 {
     yCorrect = true;
 }
</code></pre>

<p>It sounds like most simply way, but maybe there is better one? Will be grateful for some tips.</p>
