while((board.getgXPos() != board.getXPos()) && (board.getgYPos() != board.getYPos()))
{
system("cls");
board.printBoard();
board.moveBall();
}

I would like this while statement to continue repeating until both gxPos equals XPos & gyPos equals YPos.

I can't seem to figure out why the statement exits if either both x's are the same or if both y's are the same.

So you want the loop to keep running while the xPos is different or the yPos is different. You wrote while the xPos is different AND the yPos is different. The loop needs to run while either doesn't match.

while((board.getgXPos() != board.getXPos()) || (board.getgYPos() != board.getYPos()))
commented: Helpful! +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.