title: How to move a sprite with the keyboard keys using libGDX?
body: <p>i have just started using java and libgdx and have this code, very simply it prints a sprite onto the screen. This works perfectly, and i learnt a lot from it.</p>
  
  <pre><code>package com.MarioGame;
  
  import com.badlogic.gdx.ApplicationListener;
  import com.badlogic.gdx.Gdx;
  import com.badlogic.gdx.files.FileHandle;
  import com.badlogic.gdx.graphics.GL10;
  import com.badlogic.gdx.graphics.Texture;
  import com.badlogic.gdx.graphics.g2d.Sprite;
  import com.badlogic.gdx.graphics.g2d.SpriteBatch;
  import com.badlogic.gdx.graphics.g2d.TextureRegion;
  import com.badlogic.gdx.InputProcessor;
  
  public class Game implements ApplicationListener {
  private SpriteBatch batch;
  private Texture marioTexture;
  private Sprite mario;
  private int marioX;
  private int marioY;
  
  @Override
  public void create() {
      batch = new SpriteBatch();
      FileHandle marioFileHandle = Gdx.files.internal("mario.png"); 
      marioTexture = new Texture(marioFileHandle);
      mario = new Sprite(marioTexture, 0, 158, 32, 64);
      marioX = 0;
      marioY = 0;
  }
  
  @Override
  public void render() {
      Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
      batch.begin();
      batch.draw(mario, marioX, marioY);
      batch.end();
  }
  
  
  @Override
  public void resume() {
  }
  
  @Override
  public void resize(int width, int height) {
  }
  
  @Override
  public void pause() {
  }
  
  @Override
  public void dispose() {
  }
  </code></pre>
  
  <p>}</p>
  
  <p>How would I modify the <code>marioX</code> value when a user presses <code>D</code> on their keyboard?</p>