Issues moving objects with a trail with slight change
<p>So I've been trying to modify my code a bit, and I'm just so confused about why my code is going from completely working from one way to doing something completely different with such a minor change. I've been debugging this and changing very minor things, but yet when I make the change, the trail clumps up instead of keeping its distance. </p>

<p>Objective: I'm trying to figure out why a minor change is clumping up the trail instead of keeping its distance.</p>

<p>Here is where the player is moving before the minor code change and this works perfectly.</p>

<pre><code>public void Move(int delta){
    float moveSpeed = playerSpeed * delta;
    if(IsMoving() &amp;&amp; 
            (player.get(0).getX() == playerDest.get(0).getX()) &amp;&amp;
            (player.get(0).getY() == playerDest.get(0).getY())){
        for(int i = 1; i &lt; getSize(); i++){
            if(playerDest.get(i).getX() != player.get(i-1).getX()){
                playerDest.get(i).setX(player.get(i - 1).getX());
            }
            else if(playerDest.get(i).getY() != player.get(i-1).getY()){
                playerDest.get(i).setY(player.get(i - 1).getY());
            }
        }

        if(left){
            playerDest.get(0).setX(player.get(0).getX() - blockSize);
        }
        else if(right){
            playerDest.get(0).setX(player.get(0).getX() + blockSize);
        }
        else if(up){
            playerDest.get(0).setY(player.get(0).getY() - blockSize);
        }
        else if(down){
            playerDest.get(0).setY(player.get(0).getY() + blockSize);
        }
    }
    else{
        for(int i = 0; i &lt; getSize(); i++){
            if(up || down){
                if(player.get(i).getX() != playerDest.get(i).getX()){
                    player.get(i).setX(player.get(i).getX() + MoveDirection(playerDest.get(i).getX(), player.get(i).getX(), moveSpeed));
                }
                else if(player.get(i).getY() != playerDest.get(i).getY()){
                    player.get(i).setY(player.get(i).getY() + MoveDirection(playerDest.get(i).getY(), player.get(i).getY(), moveSpeed));
                }
            }
            else if(right || left){
                if(player.get(i).getY() != playerDest.get(i).getY()){
                    player.get(i).setY(player.get(i).getY() + MoveDirection(playerDest.get(i).getY(), player.get(i).getY(), moveSpeed));
                }
                else if(player.get(i).getX() != playerDest.get(i).getX()){
                    player.get(i).setX(player.get(i).getX() + MoveDirection(playerDest.get(i).getX(), player.get(i).getX(), moveSpeed));
                }
            }

    private float MoveDirection(float to, float from, float moveSpeed){
        if(to - from &gt; 0){
            return 1;
        }
        else if(to - from &lt; 0){
            return -1;
        }
        else{
            return 0;
        }
    }
</code></pre>

<p>Now the minor change to this is within the MoveDirection() method and readjusting the distance. This is just to add in a variable of movement speeds.</p>

<pre><code>        if(left){
            playerDest.get(0).setX(player.get(0).getX() - moveSpeed);
        }
        else if(right){
            playerDest.get(0).setX(player.get(0).getX() + moveSpeed);
        }
        else if(up){
            playerDest.get(0).setY(player.get(0).getY() - moveSpeed);
        }
        else if(down){
            playerDest.get(0).setY(player.get(0).getY() + moveSpeed);
        }

private float MoveDirection(float to, float from, float moveSpeed){
    return Integer.signum((int)to - (int) from) * moveSpeed;
}
</code></pre>

<p>Why am I making a minor change to the way the player moves? Depending on how fast the game is refreshing, I need to use that as a value. Hence the variable <code>delta</code> and <code>float moveSpeed;</code></p>

<p>I just don't understand why that minor change is making my trail clump up and not following its directions... I've been trying different ways for hours now. Any help is greatly appreciated!</p>

<p>Thank you!</p>
