private void update() {
		//Pause the game if we have a winner or we are not viewing the window.
		if (winner != null)// || !canvas.hasFocus())
			return;
		
		if (reset) {
			reset = false;
			return;
		}
		
		//This is to have a backup board in case a new board cannot be made (no moves = loss).
		staleBoard = board;
		
		//If true Blue goes next.
		if (turnSwitcher) {
			board = playerBlue.computeNextMove(board);
			try {
				if (board.gameOver())
					winner = playerBlue;
				else
					turnSwitcher = false;
			} catch (NullPointerException e) {
				winner = playerRed;
			}
		}
		//If false Red goes next.
		else {
			board = playerRed.computeNextMove(board);
			
			try {
				if (board.gameOver())
					winner = playerRed;
				else
					turnSwitcher = true;
			} catch (NullPointerException e) {
				winner = playerBlue;
			}
			
		}
	}