void Game_sys::ExitScreen( Player * player, Evil_bubble * evilBubble ) // SHOW THE SCORE AND RESTART THE GAME
{

    if(  !player -> Get_alive() )
    {
        force_to_play_timer += 0.02f;

        clear_to_color( buffer, makecol( 63, 72, 204 ) );

        textprintf_centre_ex( buffer, titleFont, screenwidth/2, screenheight/2 - 50, makecol( 63, 251, 0 ),
                             -1, "Your score: %i", ( player -> Get_bubbles_collected() ) );

        textprintf_centre_ex( buffer, titleFont, screenwidth/2, screenheight/2 + 50, makecol( 63, 251, 0 ),
                             -1, "please wait..." );
        BlitToScreen( !player -> Get_alive() );

        if( force_to_play_timer > 7 )
        {
			// RESET THE PLAYER, THE EVIL BUBBLE AND THE RESET TIMER
            player -> SetMembers();
            evilBubble -> SetMembers();
            force_to_play_timer = 0;
        }

    }

}
示例#2
0
/////////////////////////////////////////////////////////////////////////////
// Sets the new state and then blits the CB to the screen
//
//   int lState - specifies the state of the CB and can be:
//         BOX_ON         == checked state
//         BOX_OFF        == unchecked state
//         BOX_LDOWN_1    == mouse button down in checked state
//         BOX_LDOWN_2    == mouse button down in unchecked state
//         BOX_DISABLED_1 == CB disabled in checked state
//         BOX_DISABLED_2 == CB disabled in unchecked state
/////////////////////////////////////////////////////////////////////////////
void
ZCheckBox::SetState( int lState )
{
   if ( lState != m_lState )
   {
      m_lState = lState;

      CDC *pDC = GetDC( );
      BlitToScreen( pDC->m_hDC, lState );
      ReleaseDC( pDC );

      if ( m_bHasFocus )
         DrawFocus( TRUE );
   }
}
示例#3
0
/////////////////////////////////////////////////////////////////////////////
// Name:    OnPaint
// Description:   Blits the prepared bitmaps to the screen
/////////////////////////////////////////////////////////////////////////////
void
ZCheckBox::OnPaint( )
{
   DWORD clr1 = ::GetSysColor( COLOR_3DFACE );
   if ( m_clr != clr1 )  // sysColor changed??
   {
      for ( int k = 0; k < 6; k++ )  // => prepare bitmaps again
      {
         if ( m_bitmaps[ k ] )
         {
            DeleteObject( m_bitmaps[ k ] );  // it was subscript 0???
            m_bitmaps[ k ] = 0;
         }
      }

      m_clr = clr1;

      if ( m_brush )
         DeleteObject( m_brush );

      m_brush = ::CreateSolidBrush( m_clr );
      m_bPrepareBitmaps = TRUE;
   }

   if ( m_bHasFocus )
      DrawFocus( TRUE );

   CPaintDC dc( this );

   if ( m_bPrepareBitmaps )  // called first time or sysColor changed?
   {
      PrepareBitmaps( dc.m_hDC ); // => prepare bitmaps
      m_bPrepareBitmaps = FALSE;
   }

   BlitToScreen( dc.m_hDC, m_lState );

   if ( m_bHasFocus )
      DrawFocus( TRUE );
}