soo if you've written your code exactly how Chili did in video 12.. all you need to do is add a few lines of code after the DrawEndScreen function is executed
i'm sure there are better more logical ways of doing this but i don't know and that's why i'm here soooo
here is my version of the button
Code: Select all
void Game::ComposeFrame()
{
const int baseX = 250;
const int baseY = 150;
const int squareSize = 100;
XOState victoryState = CheckForVictory();
if( victoryState == EMPTY && nTurns < 9 )
{
DoUserInput();
DrawCursor( baseX + cursorX * squareSize,baseY + cursorY * squareSize );
}
else
{
DrawEndScreen( 358,495,victoryState );
if( kbd.EnterIsPressed())
{
activePlayer = X;
victoryState = EMPTY;
nTurns = 0;
for( int index = 0; index < 9; index++ )
{
SetSquareState( index,EMPTY );
}
}
}