1st Post!
Problem is the farther the xx is from player.layoutXProperty()…etc the faster the player moves, cause he is set to go from point A to point B in 1500ms…any ideas?
Thanks!
@Override
public void handle(MouseEvent m) {
double xx = m.getSceneX();
double yy = m.getSceneY();
Timeline t = new Timeline();
KeyValue kvX = new KeyValue(player.layoutXProperty(), xx);
KeyValue kvY = new KeyValue(player.layoutYProperty(), yy);
KeyFrame kfX = new KeyFrame(Duration.millis(1500), kvX);
KeyFrame kfY = new KeyFrame(Duration.millis(1500), kvY);
t.getKeyFrames().addAll(kfX, kfY);
t.play();