use of com.almasb.fxgl.gameplay.ScoreData in project FXGL by AlmasB.
the class RESTClientSample method initInput.
@Override
protected void initInput() {
onKeyDown(KeyCode.Q, "Get Top", () -> {
getGameplay().getLeaderboard().loadTopTask(5).onSuccess(scores -> scores.forEach(System.out::println)).executeAsyncWithDialogFX(new ProgressDialog("Connecting to FXGL server"));
});
onKeyDown(KeyCode.E, "Put New Score", () -> {
getGameplay().getLeaderboard().postNewScoreTask(new ScoreData("AlmasB", 9999)).onSuccess(n -> System.out.println("Success put")).executeAsyncWithDialogFX(new ProgressDialog("Uploading to FXGL server"));
});
}
Aggregations