Advertisement
Guest User

Untitled

a guest
Feb 10th, 2012
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.97 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <conio.h>
  4. #include <ctype.h>
  5. #include "windows.h"
  6. #include "kampf.h"
  7. using namespace std;
  8.  
  9.  
  10. int main(){    
  11.     int mpunkt = 0; // Menüpunkt, welcher grade anvisiert ist
  12.     system("color F");
  13.  
  14.     cout << "Start\tOptionen\tBeenden"; // Beispielmenü
  15.  
  16. bool exit = false;
  17. while(!exit)
  18. {
  19.     if(kbhit())
  20.     {
  21.         char c = getch();
  22.         switch(c)
  23.         {
  24.                 case 75:                            
  25.                      mpunkt = mpunkt - 1;
  26.                      if(mpunkt<0)
  27.                      {
  28.                                  mpunkt = 0;
  29.                      }
  30.                     break;
  31.  
  32.                 case 77:                          
  33.                     mpunkt = mpunkt + 1;
  34.                     if(mpunkt>2)
  35.                      {
  36.                                  mpunkt = 2;
  37.                      }
  38.  
  39.                     break;
  40.         }
  41.     }
  42.     Sleep(10);
  43.  
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement