src/gameplayer/view/LevelModel.java
public void updateScroll(Pane gameRoot){
		double minX = gameRoot.getTranslateX() * INVERT;
		double maxX = gameRoot.getTranslateX() * INVERT + PANE_WIDTH;
		double minY = gameRoot.getTranslateY() * INVERT;
		double maxY = gameRoot.getTranslateY() * INVERT + PANE_HEIGHT;

		double activePlayerX = GameManager.getActivePlayerPosX();
		double activePlayerY = GameManager.getActivePlayerPosY();

		if(activePlayerY - TOP_BOUND < minY){
			gameRoot.setTranslateY((activePlayerY - TOP_BOUND) * INVERT);
		}

		if(activePlayerY + BOTTOM_BOUND > maxY){
			gameRoot.setTranslateY(((activePlayerY + BOTTOM_BOUND) - PANE_HEIGHT) * INVERT);
		}

		if(activePlayerX - LEFT_BOUND < minX){
			gameRoot.setTranslateX((activePlayerX - LEFT_BOUND) * INVERT);
		}

		if(activePlayerX + RIGHT_BOUND > maxX){
			gameRoot.setTranslateX(((activePlayerX + RIGHT_BOUND) - PANE_WIDTH) * INVERT);
		}
	}
/**
	 * Updates the view of the Pane so that it scrolls with the player's movement. Allows for some free movement without scrolling
	 * @param gameRoot
	 */
Updates the view of the Pane so that it scrolls with the player's movement. Allows for some free movement without scrolling
@param gameRoot
Updates the view of the Pane so that it scrolls with the player ' s movement . Allows for some free movement without scrolling @param gameRoot
public void updateScroll(Pane gameRoot){
		double minX = gameRoot.getTranslateX() * INVERT;
		double maxX = gameRoot.getTranslateX() * INVERT + PANE_WIDTH;
		double minY = gameRoot.getTranslateY() * INVERT;
		double maxY = gameRoot.getTranslateY() * INVERT + PANE_HEIGHT;
		double activePlayerX = GameManager.getActivePlayerPosX();
		double activePlayerY = GameManager.getActivePlayerPosY();
		if(activePlayerY - TOP_BOUND < minY){
			gameRoot.setTranslateY((activePlayerY - TOP_BOUND) * INVERT);
		}
		if(activePlayerY + BOTTOM_BOUND > maxY){
			gameRoot.setTranslateY(((activePlayerY + BOTTOM_BOUND) - PANE_HEIGHT) * INVERT);
		}
		if(activePlayerX - LEFT_BOUND < minX){
			gameRoot.setTranslateX((activePlayerX - LEFT_BOUND) * INVERT);
		}
		if(activePlayerX + RIGHT_BOUND > maxX){
			gameRoot.setTranslateX(((activePlayerX + RIGHT_BOUND) - PANE_WIDTH) * INVERT);
		}
	}
public void updateScroll ( Pane gameRoot ) { double minX = gameRoot . getTranslateX ( ) * INVERT ; double maxX = gameRoot . getTranslateX ( ) * INVERT + PANE_WIDTH ; double minY = gameRoot . getTranslateY ( ) * INVERT ; double maxY = gameRoot . getTranslateY ( ) * INVERT + PANE_HEIGHT ; double activePlayerX = GameManager . getActivePlayerPosX ( ) ; double activePlayerY = GameManager . getActivePlayerPosY ( ) ; if ( activePlayerY - TOP_BOUND < minY ) { gameRoot . setTranslateY ( ( activePlayerY - TOP_BOUND ) * INVERT ) ; } if ( activePlayerY + BOTTOM_BOUND > maxY ) { gameRoot . setTranslateY ( ( ( activePlayerY + BOTTOM_BOUND ) - PANE_HEIGHT ) * INVERT ) ; } if ( activePlayerX - LEFT_BOUND < minX ) { gameRoot . setTranslateX ( ( activePlayerX - LEFT_BOUND ) * INVERT ) ; } if ( activePlayerX + RIGHT_BOUND > maxX ) { gameRoot . setTranslateX ( ( ( activePlayerX + RIGHT_BOUND ) - PANE_WIDTH ) * INVERT ) ; } }
Updates the view of the Pane so that it scrolls with the player's movement.
Updates the view of the Pane so that it scrolls with the player ' s movement .