Example #1
0
  public boolean keyDown(int keycode) {
    if (keycode == Keys.LEFT) controller.leftPressed(-1);

    if (keycode == Keys.RIGHT) controller.rightPressed(-1);

    if (keycode == Keys.Z) controller.jumpPressed(-1);

    if (keycode == Keys.X) controller.firePressed(-1);

    if ((keycode == Keys.BACK) || (keycode == Keys.ESCAPE)) {
      finishLevel(ExitBlock.EXIT_NOCLEAR);
    }

    return true;
  }