Advertisement
ItsWolfiy

Advancing of my C programmed-text-based game c:

Feb 8th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 16.06 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<string.h>
  4. #include<windows.h>
  5. int main(){
  6. //Tittle
  7. system("mode 79, 22");
  8. main_menu:
  9. system("cls");
  10. printf("===========\n Main Menu\n===========\n\n\n");
  11.  
  12. //Main menu
  13.     printf("1. Play\n2. Help\n3. Credits\n4. Quit Game\n\n\n"); //Selection
  14.     int mainmenuchoice;
  15.     scanf("%d", &mainmenuchoice); //Scanning
  16.     //Choices (Conditions)
  17.     if(mainmenuchoice == 1){
  18.         goto First_Frame;
  19.     }
  20.  
  21.     else if(mainmenuchoice == 2){
  22.         goto game_help;
  23.     }
  24.  
  25.     else if(mainmenuchoice == 3){
  26.         goto credits;
  27.     }
  28.  
  29.     else if(mainmenuchoice == 4){
  30.         exit(0);
  31.     }
  32.  
  33.     else {
  34.         system("cls");
  35.         printf("\n\n\n\nError: Invalid menu selected, please, select between 1, 2, 3 or 4.\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  36.         getchar(); getchar();
  37.         system("cls");
  38.         goto main_menu;
  39.     }
  40.  
  41.     //Choices
  42.     game_help:
  43.         system("cls");
  44.         printf("======\n HELP\n======\n");
  45.         printf("\n\nTo play, you simply will have to choose an action between 1 or 2 (or higher \nsometimes) by typing this number and then confirm with [ENTER].\n\n");
  46.         printf("Press [ENTER] to go back to the main menu.");
  47.         getch();
  48.         goto main_menu;
  49.  
  50.     credits:
  51.         system("cls");
  52.         printf("=========\n CREDITS\n=========\n");
  53.         printf("\n\nGame programmed in C by Wolfiy.\n\n1. Youtube\n2. Twitter\n3. Instagram\n\n9. Main Menu\n\n");
  54.         int website;
  55.         scanf("%d", &website);
  56.         if(website == 1){
  57.  
  58.             ShellExecute(NULL, "open", "https://www.YouTube.com/DarkWolfiiy", NULL, NULL, SW_SHOWNORMAL);
  59.             goto credits;
  60.         }
  61.  
  62.         else if(website == 2){
  63.             ShellExecute(NULL, "open", "https://www.Twitter.com/DarkWolfiy", NULL, NULL, SW_SHOWNORMAL);
  64.             goto credits;
  65.         }
  66.  
  67.         else if(website == 3){
  68.             ShellExecute(NULL, "open", "https://Instagram.com/WolfiyEditor", NULL, NULL, SW_SHOWNORMAL);
  69.             goto credits;
  70.         }
  71.  
  72.         else if(website == 9){
  73.             goto main_menu;
  74.         }
  75.  
  76.         else {
  77.             system("cls");
  78.             printf("\n\n\n\nError: Invalid link selected, please, select between 1, 2, 3 or 9.\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  79.             getchar(); getchar();
  80.             system("cls");
  81.             goto credits;
  82.         }
  83.         getchar();
  84.  
  85.     //====================================================GAME=================================================================
  86.     //First Frame (1)
  87.     First_Frame:
  88.         system("cls");
  89.         printf("\n\n???: \nHey, you, who are you? Why are you here?\n\n\t1. Ah... My head hurt so much... Where am I..?\n\t2. WO-WO-WO-WOW who are YOU? Why did you bring me HERE?\n\n");
  90.         int first_frame_choice;
  91.         scanf("%d", &first_frame_choice);
  92.         if(first_frame_choice == 1){
  93.             goto first_frame_choice_1;
  94.         }
  95.         else if(first_frame_choice == 2){
  96.             goto first_frame_choice_2;
  97.         }
  98.         else {
  99.             system("cls");
  100.             printf("\n\n\n\nError: Invalid selection. Please, select between 1 or 2.\n\n\n\n\t\tPress [ENTER] to continue.\n\n"); //
  101.             getchar(); getchar();
  102.             system("cls");
  103.             goto First_Frame;
  104.         }
  105.  
  106.         //first_frame_choice_1
  107.         first_frame_choice_1:
  108.             system("cls");
  109.             printf("\n\n???: \nI can't tell it to you. Not now. Not here. Follow me.\n\n");
  110.             goto frame_2_way_1;
  111.  
  112.         //first_frame_choice_2
  113.         first_frame_choice_2:
  114.             system("cls");
  115.             printf("\n\n???: \npssssssh be quiet! They are listening!\n\n");
  116.             goto frame_2_way_2;
  117.  
  118.     //Second Frame (2)
  119.     frame_2_way_1:
  120.         printf("\t1. Why..?\n\t2. I want explications, and NOW!\n\n");
  121.         int choice_frame_2_way_1;
  122.         scanf("%d", &choice_frame_2_way_1);
  123.         if(choice_frame_2_way_1 == 1){
  124.             goto answer_frame_2_way_1_1;
  125.         }
  126.         else if(choice_frame_2_way_1 == 2){
  127.             goto answer_frame_2_way_1_2;
  128.         }
  129.         else {
  130.             system("cls");
  131.             printf("\n\n\n\nError: Invalid selection. Please, select between 1 or 2.\n\n\n\n\t\tPress [ENTER] to continue.\n\n"); //
  132.             getchar(); getchar();
  133.             system("cls");
  134.             goto first_frame_choice_1;
  135.         }
  136.  
  137.     frame_2_way_2:
  138.         printf("\t1. *whispering* What..? Who is listening?\n\t2. *shouting* LAAAALALAlALALAAAAALALLALLA!!!\n\n");
  139.         int choice_frame_2_way_2;
  140.         scanf("%d", &choice_frame_2_way_2);
  141.         if(choice_frame_2_way_2 == 1){
  142.             goto answer_frame_2_way_2_1;
  143.         }
  144.         else if(choice_frame_2_way_2 == 2){
  145.             goto answer_frame_2_way_2_2;
  146.         }
  147.         else {
  148.             system("cls");
  149.             printf("\n\n\n\nError: Invalid selection. Please, select between 1 or 2.\n\n\n\n\t\tPress [ENTER] to continue.\n\n"); //
  150.             getchar(); getchar();
  151.             system("cls");
  152.             goto first_frame_choice_2;
  153.         }
  154.  
  155.         //Answers
  156.         answer_frame_2_way_1_1:
  157.             system("cls");
  158.             printf("\n\n???: \nI can't explain now. Just follow me. I won't hurt you, and if I would, I could \nnot.\n\n");
  159.             goto frame_3_way_1_1;
  160.  
  161.         answer_frame_2_way_1_2:
  162.             system("cls");
  163.             printf("\n\n???: \nStop shouting! If they find us, they'll kill us!\n\n");
  164.             goto frame_3_way_1_2;
  165.  
  166.         answer_frame_2_way_2_1:
  167.             system("cls");
  168.             printf("\n\n???: \nI can't tell you know, if they find us, we're dead! Just follow me.\n\n");
  169.             goto frame_3_way_2_1;
  170.  
  171.         answer_frame_2_way_2_2:
  172.             system("cls");
  173.             printf("\n\n???: \nNooo! Stop! They are ready to kill us if the find you! If you die here, you're \ndead for real!\n\n");
  174.             goto frame_3_way_2_2;
  175.  
  176.     //Third Frame (3)
  177.     frame_3_way_1_1:
  178.         printf("\t1. Ummm... Okay...\n\t2. And why should I trust you?\n\n");
  179.         int choice_frame_3_way_1_1;
  180.         scanf("%d", &choice_frame_3_way_1_1);
  181.         if(choice_frame_3_way_1_1 == 1){
  182.             goto answer_frame_3_way_1_1;
  183.         }
  184.         else if(choice_frame_3_way_1_1 == 2){
  185.             goto answer_frame_3_way_1_1_2;
  186.         }
  187.         else {
  188.             system("cls");
  189.             printf("\n\n\n\nError: Invalid selection. Please, select between 1 or 2.\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  190.             getchar(); getchar();
  191.             system("cls");
  192.             goto answer_frame_2_way_1_1;
  193.         }
  194.  
  195.     frame_3_way_1_2:
  196.         printf("\t1. If you say so...\n\t2. But who?!\n\n");
  197.         int choice_frame_3_way_1_2;
  198.         scanf("%d", &choice_frame_3_way_1_2);
  199.         if(choice_frame_3_way_1_2 == 1){
  200.             goto answer_frame_3_way_1_2;
  201.         }
  202.         else if(choice_frame_3_way_1_2 == 2){
  203.             goto answer_frame_3_way_1_2_2;
  204.         }
  205.         else {
  206.             system("cls");
  207.             printf("\n\n\n\nError: Invalid selection. Please, select between 1 or 2.\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  208.             getchar(); getchar();
  209.             system("cls");
  210.             goto answer_frame_2_way_1_2;
  211.         }
  212.  
  213.     frame_3_way_2_1:
  214.         printf("\t1. Okay...\n\t2. Mmmh...k...\n\n");
  215.         int choice_frame_3_way_2_1;
  216.         scanf("%d", &choice_frame_3_way_2_1);
  217.         if(choice_frame_3_way_2_1 == 1){
  218.             goto answer_frame_3_way_2_1;
  219.         }
  220.         else if(choice_frame_3_way_2_1 == 2){
  221.             goto answer_frame_3_way_2_1_2;
  222.         }
  223.         else {
  224.             system("cls");
  225.             printf("\n\n\n\nError: Invalid selection. Please, select between 1 or 2.\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  226.             getchar(); getchar();
  227.             system("cls");
  228.             goto answer_frame_2_way_2_1;
  229.         }
  230.  
  231.     frame_3_way_2_2:
  232.         printf("\t1. Wow. Couldn't you say it before?\n\t2. What do you mean by %cdead for real%c ? o.O\n\n", 34, 34);
  233.         int choice_frame_3_way_2_2;
  234.         scanf("%d", &choice_frame_3_way_2_2);
  235.         if(choice_frame_3_way_2_2 == 1){
  236.             goto answer_frame_3_way_2_2;
  237.         }
  238.         else if(choice_frame_3_way_2_2 == 2){
  239.             goto answer_frame_3_way_2_2_2;
  240.         }
  241.         else {
  242.             system("cls");
  243.             printf("\n\n\n\nError: Invalid selection. Please, select between 1 or 2.\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  244.             getchar(); getchar();
  245.             system("cls");
  246.             goto answer_frame_2_way_2_2;
  247.         }
  248.  
  249.         //Answers
  250.         answer_frame_3_way_1_1:
  251.             system("cls");
  252.             printf("\n\n???: \nOkay, so be quiet and keep being close from me. Do NOT make any noise.\n\n");
  253.             goto frame_4_start;
  254.  
  255.         answer_frame_3_way_1_1_2:
  256.             system("cls");
  257.             printf("\n\n???: \nBecause i'm the only one that can help you.\n\n");
  258.             goto frame_4_start;
  259.  
  260.         answer_frame_3_way_1_2:
  261.             system("cls");
  262.             printf("\n\n???: \nK, follow me, be quiet, keep being close.\n\n");
  263.             goto frame_4_start;
  264.  
  265.         answer_frame_3_way_1_2_2:
  266.             system("cls");
  267.             printf("\n\n???: \nFollow me. You'll know everything, but later.\n\n");
  268.             goto frame_4_start;
  269.  
  270.         answer_frame_3_way_2_1:
  271.             system("cls");
  272.             printf("\n\n???: \nTrust me, I'll help you.\n\n");
  273.             goto frame_4_start;
  274.  
  275.         answer_frame_3_way_2_1_2:
  276.             system("cls");
  277.             printf("\n\n???: \nJust trust me. Without me, you're dead, just follow me.\n\n");
  278.             goto frame_4_start;
  279.  
  280.         answer_frame_3_way_2_2:
  281.             system("cls");
  282.             printf("\n\n???: \nYeaaaa sorry, so follow me or um... yea, you see what I mean...\n\n");
  283.             goto frame_4_start;
  284.  
  285.         0answer_frame_3_way_2_2_2:
  286.             system("cls");
  287.             printf("\n\n???: \nYou'll understand soon. Just follow me.\n\n");
  288.             goto frame_4_start;
  289.  
  290.     //Fourth Frame (4)
  291.     frame_4_start:
  292.         printf("\t1. Well... okay...");
  293.         int starting;
  294.         scanf("%d", &starting);
  295.         if(starting == 1){
  296.             goto frame_5_explications;
  297.         }
  298.         else {
  299.             system("cls");
  300.             printf("\n\n\n\nError: Invalid selection. Please, select between 1 or 2.\n\n\n\n\t\tPress [ENTER] to continue.\n\n"); // MODIFY
  301.             getchar(); getchar();
  302.             system("cls");
  303.             goto frame_4_start;
  304.         }
  305.  
  306.     //Fifth Frame (5)
  307.     frame_5_explications:
  308.         printf("   ");
  309.         getchar();
  310.         system("cls");
  311.         printf("\n\n===Later===\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  312.         getchar();
  313.         system("cls");
  314.         printf("\n\n???: \nOkay, so we're finally arrived.\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  315.         getchar();
  316.         system("cls");
  317.         printf("\n\n???: \nJust let me check that we are in security.\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  318.         getchar();
  319.         system("cls");
  320.         printf("\n\n???: \nWell... everything looks okay...\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  321.         getchar();
  322.         system("cls");
  323.         printf("\n\n???: \nJust one more thing and... here we are!\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  324.         getchar();
  325.         system("cls");
  326.         printf("\n\n???: \nSo, I'm sure you'd like to know who I am, but it's not really important.\nJust call me... I don't know, just choose yourself.");
  327.         char unknown_guy_name[70];                                                              /* NPC's name char */
  328.         printf("\n\n\tHow would you like to call him? (Press [ENTER] to confirm)  ");           /* NPC's name (asking) */
  329.         scanf("%s", unknown_guy_name);                                                          /* NPC's name scan */
  330.         getchar();
  331.         //Question Frame 5
  332.         questions_frame_5:
  333.         system("cls");
  334.         printf("\n\n%s:\n", unknown_guy_name);                                                  /*NPC's Talking printf*/
  335.         printf(unknown_guy_name);
  336.         printf("? Well... If you want... Anyway... any questions?\n\n\t1. Where am I?\n\t2. Why did you bring me there?\n\n");
  337.         int choice_questions_frame_5;
  338.         scanf("%d", &choice_questions_frame_5);
  339.         if(choice_questions_frame_5 == 1){
  340.             goto answer_frame_5_way_1;
  341.         }
  342.         else if(choice_questions_frame_5 == 2){
  343.             goto answer_frame_5_way_2;
  344.         }
  345.         else {
  346.             system("cls");
  347.             printf("\n\n\n\nError: Invalid selection. Please, select between 1 or 2.\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  348.             getchar(); getchar();
  349.             system("cls");
  350.             goto questions_frame_5;
  351.         }
  352.         //Ways Frame 5
  353.         answer_frame_5_way_1:
  354.             system("cls");
  355.             printf("\n\n%s:\n", unknown_guy_name);
  356.             printf("Well... It's hard to explain but... You kinda are...In a computer...\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  357.             getchar(); getchar();
  358.             goto other_frame_5_questions;
  359.  
  360.         answer_frame_5_way_2:
  361.             system("cls");
  362.             printf("\n\n%s:\n", unknown_guy_name);
  363.             printf("I bring you there for a simple reason: your life.\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  364.             getchar(); getchar();
  365.             goto other_frame_5_questions;
  366.         //Frame 5 Other Questions
  367.         other_frame_5_questions:
  368.             system("cls");
  369.             int choice_other_frame_5_questions;
  370.             printf("\n\n%s:\n", unknown_guy_name);
  371.             printf("Do you want to know anything else?");
  372.             //Questions
  373.             if(choice_questions_frame_5, choice_other_frame_5_questions == 1){
  374.                 printf("\n\n\t1. Can you repeat where I am..?");
  375.             } else {
  376.                 printf("\n\n\t1. Where am I?");
  377.             }
  378.             if(choice_questions_frame_5, choice_other_frame_5_questions == 2){
  379.                 printf("\n\t2. Can you repeat why did you bring me there?");
  380.             } else {
  381.                 printf("\n\t2. Why did you bring me there?");
  382.             }
  383.             printf("\n\t3. So... What are you hiding me?\n\n");
  384.  
  385.             scanf("%d", &choice_other_frame_5_questions);
  386.             if(choice_other_frame_5_questions == 1){
  387.                 goto answer_frame_5_way_1;
  388.             }
  389.             else if(choice_other_frame_5_questions == 2){
  390.                 goto answer_frame_5_way_2;
  391.             }
  392.             else if(choice_other_frame_5_questions == 3){
  393.                 goto answer_other_frame_5_questions_3;
  394.             }
  395.             else {
  396.             system("cls");
  397.             printf("\n\n\n\nError: Invalid selection. Please, select between 1, 2 or 3.\n\n\n\n\t\tPress [ENTER] to continue.\n\n");
  398.             getchar(); getchar();
  399.  
  400.             goto other_frame_5_questions;
  401.         }
  402.  
  403.         //Frame 5 Explications
  404.             answer_other_frame_5_questions_3:
  405.                 system("cls");
  406.                 printf("   ");
  407.                 getchar();
  408.                 system("cls");
  409.                 printf("\n\n%s:\nWell, I won't hide you the truth anymore, but I don't know everything...\n\n\n\n\t\tPress [ENTER] to continue.\n\n", unknown_guy_name);
  410.                 getchar();
  411.                 system("cls");
  412.                 printf("\n\n%s:\nBut to do simple, you're on a world that you could qualify as unreal, because \nit's inside a computer program.\n\n\n\n\t\tPress [ENTER] to continue.\n\n", unknown_guy_name);
  413.                 getchar();
  414.                 system("cls");
  415.                 printf("\n\n%s:\nI don't know how, but you got teleported here. I told you to come here, because \nI have my little theory 'bout this.\n\n\n\n\t\tPress [ENTER] to continue.\n\n", unknown_guy_name);
  416.                 getchar();
  417.                 system("cls");
  418.                 printf("");
  419.                 getchar();
  420.                 system("cls");
  421.  
  422.  
  423.  
  424.  
  425.  
  426.         getch();
  427.         return(0);
  428. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement