title: How do i change the distance as game accelerates?
body: <p>I am trying to make a game like <a href="http://adamatomic.com/canabalt/" rel="nofollow">Canabalt</a> with JAVA using LibGDX, in the game the background accelerates right to left while the player stays on the same position.The distance increases by 1 every second and the speed accelerates by 0.15f like this:</p>
  
  <pre><code>public void update(float delta){
      timeState += delta;
      speed += 0.15f;
  
      if(timeState &gt;= 1){
          timeState = 0f;
          distance += 1;
      }
  
      if (speed &gt; MAX_SPEED) speed = MAX_SPEED;
  
  }
  </code></pre>
  
  <p>But i don't want the distance to be constant, i want it to change relative to the speed. So as the speed increases the distance starts to increment faster too. And when the max speed is reached the distance increment should also be constant. How can i archieve that?</p>