public void printCurrentState() { System.out.println( "curPosX: " + car.getTranslateX() + "\tcurPosY: " + car.getTranslateX() + "\tangle: " + curAngle); }
public void makeMove() { double curPosX = car.getTranslateX() + curSpeedX; if (Math.abs(curPosX) > (sceneWidth.get() / 2)) curPosX = -Math.signum(curPosX) * (sceneWidth.get() / 2 - 1); car.setTranslateX(curPosX); double curPosY = car.getTranslateY() + curSpeedY; if (Math.abs(curPosY) > (sceneHeight.get() / 2)) curPosY = -Math.signum(curPosY) * (sceneHeight.get() / 2 - 1); car.setTranslateY(curPosY); }