//============================================================================= // MenuManager::Quit // //============================================================================= int GameEngine::Quit(void) { char c='\0'; BM.TypeString(63, 6, " \0", m_color(R_BLUE,R_GREY,0,1)); BM.TypeString(79, 6, "_", m_color(R_BLUE, R_BROWN, 1,1)); BM.TypeString(64, 6, "End this game?\0", m_color(R_BLUE,R_GREY,0,1)); // check answer while ( (c!='y') && (c!='Y') && (c!='n') && (c!='N') ) { // read a key from the keyboard buffer. c=MM.GetChar(); } // if yes was typed, pass the exit code to the calling loop. if (c=='y' || c=='Y') return 1; else { // otherwise, redraw the GAMNEMENU and return the exit code. MM.DrawMenu(GAMEMENU); return 0; } }