예제 #1
0
  @Override
  public boolean touchDown(int screenX, int screenY, int pointer, int button) {
    // TODO: Unproject the touch from the screen to the world
    Vector2 worldTouch = viewport.unproject(new Vector2(screenX, screenY));

    // TODO: Check if the touch was inside a button, and launch the icicles screen with the
    // appropriate difficulty

    if (worldTouch.dst(Constants.EASY_CENTER) < Constants.DIFFICULTY_BUBBLE_RADIUS) {
      game.showGameScreen(Constants.Difficulty.EASY);
    }

    if (worldTouch.dst(Constants.MEDIUM_CENTER) < Constants.DIFFICULTY_BUBBLE_RADIUS) {
      game.showGameScreen(Constants.Difficulty.MEDIUM);
    }

    if (worldTouch.dst(Constants.HARD_CENTER) < Constants.DIFFICULTY_BUBBLE_RADIUS) {
      game.showGameScreen(Constants.Difficulty.HARD);
    }

    return true;
  }