Advertisement
FoxTuGa

RPGMain.c

Jan 15th, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.32 KB | None | 0 0
  1. // Game Created by: Leandro Soares & Tiago Queiros
  2. // School: INETE; TGPSI10/01
  3.  
  4. #include "sources.h"
  5. #include "RPGMenu_Geral.h"
  6. #include "items.h"
  7. #include "shop.h"
  8.  
  9. #define GameName "GAME"
  10. #define MaxItems 200
  11.  
  12. void ShowGameName(void);
  13.  
  14. int main() {
  15.     char name[MaxName];
  16.     char option;
  17.     int total_items, first_time=0;
  18.     struct tagItem *items[MaxItems];
  19.     struct tagMobs *player;
  20.     HANDLE hConsole;
  21.     hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
  22.  
  23.     total_items = 0;
  24.     option = name[0] = '\0';
  25.  
  26.     CreateAllItems(items, &total_items);
  27.  
  28.     while(TRUE) {
  29.         system("cls");
  30.         SetConsoleTextAttribute(hConsole, FOREGROUND_GREEN);
  31.         ShowGameName();
  32.         SystemPause();
  33.  
  34.         option = Menu_Geral(name);
  35.         if(first_time == 0) {
  36.             player = NewMob(name);
  37.             first_time++;
  38.             PrintShop_Armour(items, player, total_items);
  39.         }
  40.  
  41.         if( option == 'q') {
  42.             Menu_Shop(items, player, total_items);
  43.         }
  44.         else if( option == 'w' ) {
  45.             //TODO: Create Inn
  46.         }
  47.         else if( option == 'e' ) {
  48.             //TODO: Create Action
  49.         }
  50.         else if( option == 'r' ) {
  51.             //TODO: Create Level Up
  52.         }
  53.         else if( option == 't' ) {
  54.             //TODO: Create Exit
  55.         }
  56.         else {
  57.             printf("Bug nas opcoes do menu geral!\n\n");
  58.             SystemPause();
  59.         }
  60.     }
  61.  
  62. }
  63.  
  64. void ShowGameName(void) {
  65.     CenterText("Welcome to the text based game named *Change This* !!!\n\n");
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement