title: Jump speed increasing I don't know why Libgdx
body: <p>I'm creating a 2D game. I have a character which can move LEFT, RIGHT and JUMP. But every jump is faster and I donat know why. </p>
  
  <p>When I start the game first, the jump is OK. But every next jump is faster. I think something is increasing the speed but I don't know what. </p>
  
  <p>Can someone look into my code?</p>
  
  <p>Here is my MainCharacter class:</p>
  
  <pre><code>public class MainCharacter {
      private static final int GRAVITY = -5;
      private static final int MOVEMENT = 5;
  
      private Vector3 position;
      private Vector3 velocity;
  
      private Texture character;
  
      public MainCharacter(int x, int y){
          position = new Vector3(x,y,0);
          velocity = new Vector3(0,0,0);
          character = new Texture("character.png");
      }
  
      public void update(float dt)
      {
          if(position.y&gt;50)
              velocity.add(0,GRAVITY,0);
          velocity.scl(dt);
          position.add(0,velocity.y,0);
          if(position.y&lt;=50)
              position.y=50;
          velocity.scl(1/dt);
      }
  
      public void moveLeft(){position.x=(position.x-MOVEMENT);}
  
      public void moveRight(){position.x=(position.x+MOVEMENT);}
  
      public void jump(){
          if(position.y==50){
              position.y=150;
          }
  
      }
      public Vector3 getPosition(){ return position; }
  
      public Texture getTexture(){ return character; }
  }
  </code></pre>
  
  <p>And this is my PlayState:</p>
  
  <pre><code>public class PlayState extends State {
  
      private Texture bg;
      private MainCharacter character;
  
      public PlayState(GameStateManager gsm){
          super(gsm);
          bg = new Texture("bg.png");
          character = new MainCharacter(500,50);
          cam.setToOrtho(false,State.WIDTH,State.HEIGHT);
      }
  
      @Override
      protected void handleInput() {
          for(int i=0;i&lt;3;i++) {
              if (Gdx.input.isTouched(i)) {
  
                  int x = Gdx.input.getX(i);
                  int y = Gdx.input.getY(i);
                  if (x &lt; State.WIDTH / 2 &amp;&amp; y &gt; State.HEIGHT / 2) {
                      character.moveLeft();
                  } else if (x &gt;= State.WIDTH / 2 &amp;&amp; y &gt; State.HEIGHT / 2) {
                      character.moveRight();
                  } else if (x &lt; State.WIDTH / 2 &amp;&amp; y &lt; State.HEIGHT / 2) {
                      character.jump();
                  }
  
              }
          }
  
      }
  
  
      @Override
      protected void update(float dt) {
          handleInput();
          character.update(dt);
      }
  
      @Override
      public void render(SpriteBatch sb) {
          sb.setProjectionMatrix(cam.combined);
          sb.begin();
          sb.draw(bg,0,0);
          sb.draw(character.getTexture(), character.getPosition().x,character.getPosition().y);
          sb.end();
      }
  
      @Override
      public void dispose() {
  
      }
  }
  </code></pre>