Javafx having pane follow game character
<p>I'm attempting to create a simple RPG game using javafx. So far, I've gotten my character to show up on screen, move around, and not bump into obstacles. I've accomplished this by use of a Board class, which acts as a grid:</p>

<pre><code>public class TestBoard extends Pane{

    public static final int TILE_SIZE = 40;
    public static final int X_DIM_TILES = 10;
    public static final int Y_DIM_TILES = 10;
    private Image TREE = new Image(Game.class.getResource("tree.png").toString());
    private Image GRASS = new Image(Game.class.getResource("grasssquare.png").toString());
    private Character character;
    private GameTile[][] tiles = new GameTile[X_DIM_TILES][Y_DIM_TILES];
    public TestBoard(){

        this.setPrefWidth(TILE_SIZE * X_DIM_TILES);
        this.setPrefHeight(TILE_SIZE * Y_DIM_TILES);
        setUpScreen();
        character = new Character(this);
        addCharacter();
    }
    public boolean checkTile(double x, double y){
        return (x &lt; X_DIM_TILES &amp;&amp; x &gt;= 0 &amp;&amp; y &lt; Y_DIM_TILES &amp;&amp; y &gt;= 0 &amp;&amp; tiles[(int)x][(int)y].getPassable());
    }
    public Character getCharacter(){
        return character;
    }
    public void addCharacter(){
        character.setLocation(4, 4);

    }
    public GameTile getTile(int x, int y){
        return tiles[x][y];
    }
    public void setUpScreen(){
        for (int i = 0; i &lt; X_DIM_TILES; i++){
            for (int j = 0; j &lt; Y_DIM_TILES; j++){
                addTile(i, j, GRASS, true);
            }
        }
        for (int j = 1; j &lt; Y_DIM_TILES-1; j++){
            addTile(1, j, TREE, false);
        }
    }
    public void addTile(int xCord, int yCord, Image image, boolean passable){
        SceneryTile tile = new SceneryTile(this, image, passable);
        tile.setLocation(xCord, yCord);
        tiles[xCord][yCord] = tile; 
    }
}
</code></pre>

<p>Basically, this class holds a collection of GameTiles and has the Character object. It works fine the way it's set up, but I want the screen to only show my main character without the entire screen showing, like real RPGs do. Right now, the whole level screen appears. I want to be able to have the screen move with my character and not reveal the entire screen.</p>

<pre><code>public void start(Stage primaryStage) throws Exception {
    board = new TestBoard();
    testManager = new TestManager(this, board);
    Scene scene = new Scene(board);
    primaryStage.setScene(scene);
    primaryStage.show();
    setUpAnimation();
    setUpKeyPresses();
}
</code></pre>

<p><img src="https://i.stack.imgur.com/3kNRJ.png" alt="How the screen appears"></p>

<p>If more documentation is needed, please let me know! Thanks.</p>