public void update() {
    int xa = 0;
    int ya = 0;
    if (this.input.left) {
      xa--;
    }
    if (this.input.right) {
      xa++;
    }
    if (this.input.up) {
      ya--;
    }
    if (this.input.down) {
      ya++;
    }

    this.x += xa * speed;
    this.y += ya * speed;

    if (this.x < 0) {
      this.x = 0;
    }
    if (this.x > (level.width << 4) - (MainGame.WIDTH * MainGame.SCALE / 2)) {
      this.x = (level.width << 4) - (MainGame.WIDTH * MainGame.SCALE / 2);
    }
    if (this.y < 0) {
      this.y = 0;
    }
    if (this.y > (level.height << 4) - (MainGame.HEIGHT * MainGame.SCALE / 2)) {
      this.y = (level.height << 4) - (MainGame.HEIGHT * MainGame.SCALE / 2);
    }
  }