所以,我在减少完成任务所需的时间方面遇到了问题, 程序必须用一个StopTransition移动球并减少这样做所需的时间(增加移动速度)......任何帮助都会很好......
Duration time = new Duration(16.666666667);
t1 = new PauseTransition(time);
t1.setOnFinished((e) -> {
if (cr.getCenterX() + 10 < 320)
cr.setCenterX(cr.getCenterX() + 1);
t1.playFromStart();
});
t1.play();
t2.setOnFinished(e ->{
Duration t=t1.getDuration().subtract(new Duration(1));
t1.stop();
t1.setDuration(t);
t1.play();
t2.playFromStart();
});
t2.play();