public GameFrame() {
        // set the title on the frame
        super("Boat Game!!!");  
        
        // Builds the Frame and adds the Game Panel to it
        buildFrame();
        
        // infinite animation loop, program halts when window is closed.
        while (true) {
            pause(); 
            gamePanel.move();
            gamePanel.repaint();
            if (endTheGame) {
                if (gamePanel.getGameWon() == true) {
                    this.dispose();
                    new WinScreen();
                    endTheGame = false;
                } else if (gamePanel.getGameLost() == true) {
                    this.dispose();
                    new GameOverScreen();
                    endTheGame = false;
                }
            }
            
            
        }
    }