this one is a new function so add it to the Game.h user functions
Code: Select all
void Game::ResetFace()
{
faceX = 400;
faceY = 300;
}
this one is also a new function so add it!
Code: Select all
void Game::NewPoo()
{
for( int index = 0; index < NPOO; index++ )
{
pooX[ index ] = rand() % (800 - 24);
pooY[ index ] = rand() % (600 - 24);
pooXVelocity[ index ] = (rand() % 8001) / 1000.0f - 4.0f;
pooYVelocity[ index ] = (rand() % 8001) / 1000.0f - 4.0f;
}
}
add this code after 'DrawGameOver' so your Game::ComposeFrame() looks like this
Code: Select all
void Game::ComposeFrame()
{
gfx.DrawDisc( goalX,goalY,GOALRAD,255,255,0 );
for( int index = 0; index < nPoo; index++ )
{
DrawPoo( pooX[ index ],pooY[ index ] );
}
DrawFace( faceX, faceY );
if( gameIsOver )
{
DrawGameOver( 375,275 );
if( kbd.EnterIsPressed())
{
gameIsOver = false;
nPoo = 0;
ResetGoal();
ResetFace();
NewPoo();
}
}
}