CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Menu problems

Threaded View

  1. #1
    Join Date
    Feb 2011
    Posts
    1

    Question Menu problems

    Ok, I was bored so I started to make a console game. I got my main menu constructed, not linked though. And started on my options. It goes to the options screen fine, but as soon as the function comes up where i go to choose text color, it does nothing. No more text entry, nothing. I uploaded a picture with it to show what i mean. I've done the "or" function before and it worked, but I think that's what's having the problem now. Here's my code:

    Code:
    #include <iostream>
    #include <Windows.h>
    using namespace std;
    
    int name;
    int mainmenutext;
    int gametext;
    
    
    char mainmenu[50];
    char mainoptions[50];
    char optiontextcolor[50];
    int main () {
    
    	HANDLE hConsole;
    
     hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    
     mainmenutext = 12;
    
      SetConsoleTextAttribute(hConsole, mainmenutext);
    
      cout <<"                                   BlackMethod                                  " <<endl;
      cout <<"                                    Presents                                    " <<endl;
      
      Sleep (2500);
      system ("cls");
      mainmenutext = 116;
       SetConsoleTextAttribute(hConsole, mainmenutext);
      cout <<"                                   City Runner                                  " <<endl;
      Sleep (3000);
      system ("cls");
      cout <<"                                    Main Menu                                   " <<endl;
      cout <<"                                                                                " <<endl;
      cout <<"                                     New Game                                   " <<endl;
      cout <<"                                    Load Game                                   " <<endl;
      cout <<"                                      Info                                      " <<endl;
      cout <<"                                     Options                                    " <<endl;
      cin.getline (mainmenu, 50);
      while (mainmenu == "Options");
      mainmenutext = 235;
      SetConsoleTextAttribute(hConsole, mainmenutext);
      system ("cls");
      cout <<"                                     Options                                    " <<endl;
      cout <<"                                                                                " <<endl;
      cout <<"                                    Text color                                  " <<endl;
      cout <<"                                    Main menu                                   " <<endl;
      cin.getline (mainoptions, 50);
      while (mainoptions == "Text color" || "Text Color" || "Text Colour" || "Text colour");
      system ("cls");
      cout <<"                      What color would you like the text in game?               " <<endl;
      cout <<"                             Blue, green, red, white etc.                       " <<endl;
      cout <<"                        Please try only simple spectrum colors.                 " <<endl;
      cin.getline (optiontextcolor, 50);
    
      while (optiontextcolor == "Blue");
      gametext = 1;
      cout <<"                            Text sucessfully set as blue!                       " <<endl;
    
     
      return 0;
    }
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured