@FXML private ImageView bg1, bg2, player; private final int BG_WIDTH = 800; private ParallelTransition parallelTransition; @FXML void initialize() { TranslateTransition bgOneTrans = new TranslateTransition(Duration.millis(5000), bg1); bgOneTrans.setFromX(0); bgOneTrans.setByX(BG_WIDTH * -1); bgOneTrans.setInterpolator(Interpolator.LINEAR); bgOneTrans.autoReverseProperty(); TranslateTransition bgTwoTrans = new TranslateTransition(Duration.millis(5000), bg2); bgTwoTrans.setFromX(0); bgTwoTrans.setByX(BG_WIDTH * -1); bgTwoTrans.autoReverseProperty(); bgTwoTrans.setInterpolator(Interpolator.LINEAR); parallelTransition = new ParallelTransition(bgOneTrans, bgTwoTrans); parallelTransition.setCycleCount(Animation.INDEFINITE); parallelTransition.play(); }