title: Moving object by single touch - Libgdx
body: <p>May be this will be a very basic question,but as a newbie,I am confused of it.</p>
  
  <p>In my libGDX Project,I wants to move the player.
  Initially player is on left side.For the first tap player should move to opposite side and occupy the position there.for the next tap it should move to left.and will continue like this.</p>
  
  <p>I implemented this logic.Now problem is that my player is not at all moving but just occupying the opposite position on tap.I used a velocity value but it does not make any effect on the code.</p>
  
  <p>I want to make it move along the way,not just occupying the position.
  Please help.</p>
  
  <pre><code> public  float ninjaX = Constants.W_WIDTH;
  public  float ninjaY =Constants.WORLD_HEIGHT/2+Constants.WORLD_HEIGHT/4;
  public  float ninjaVelocity =100f;
  public boolean isLeftBool=true;
  
  public void ninjaMove() {
      if (isLeftBool) {
  
  
              ninjaX = ninjaX+ ninjaVelocity;
              setPosition(Constants.WORLD_WIDTH - (Constants.W_WIDTH+Constants.PLAYER_HEIGHT/2), ninjaY);
  
          isLeftBool = false;
  
      }
      else 
      {
          ninjaX=ninjaX-ninjaVelocity;
          setPosition(ninjaX,ninjaY);
          isLeftBool = true;
      }
  
  }
  </code></pre>
  
  <p>updating player in render:</p>
  
  <pre><code>if (MyInputProcessor.isTap) {
          MyInputProcessor.isTap = false;
          ninja.ninjaMove();
  
      }
  </code></pre>