Advertisement
Guest User

Untitled

a guest
Nov 6th, 2020
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 10.43 KB | None | 0 0
  1. using System;
  2.  
  3. namespace RPG
  4. {
  5.     class MainClass
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.             //Done(); will check if Cords are at end of game
  10.  
  11.  
  12.             //variables
  13.             string response = "";
  14.             string name = "";
  15.             bool hastyped = false;
  16.  
  17.             //Coordinates
  18.             int xCord = 0; int yCord = 0;
  19.  
  20.  
  21.             void Done()
  22.             {
  23.                 if (yCord == 5 && xCord == 7)
  24.                 {
  25.                     Console.WriteLine("Thanks for playing! You did it!");
  26.                 }
  27.             }
  28.  
  29.             void Move()
  30.             {
  31.                 if (hastyped == true)
  32.                 {
  33.                     if (response == "E")
  34.                     {
  35.                         xCord = xCord + 1;
  36.                     }
  37.                     else if (response == "W")
  38.                     {
  39.                         xCord = xCord - 1;
  40.                     }
  41.                     else if (response == "N")
  42.                     {
  43.                         xCord = xCord + 1;
  44.                     }
  45.                     else if (response == "S")
  46.                     {
  47.                         xCord = xCord - 1;
  48.                     }
  49.                     else
  50.                     {
  51.                         Console.WriteLine("That movement is invalid.");
  52.                     }
  53.  
  54.                     hastyped = false;
  55.                     response = "";
  56.                     Done();
  57.                 }
  58.             }
  59.  
  60.  
  61.             //FANCY START LOGO
  62.             Console.WriteLine(@"
  63. ____________ _____
  64. | ___ \ ___ \  __ \
  65. | |_/ / |_/ / |  \/
  66. |    /|  __/| | __
  67. | |\ \| |   | |_\ \
  68. \_| \_\_|    \____/
  69. "
  70.             );
  71.             System.Threading.Thread.Sleep(2500);
  72.  
  73.             while (response != "Y")
  74.             {
  75.                 Console.WriteLine("Please answer with Y for yes and N for no. Please try to answer all questions as simply as possible.\nPlease type N for north, E for east, S for south and W for west.");
  76.                 Console.WriteLine("Ok?");
  77.                 response = Console.ReadLine();
  78.  
  79.                 if (response == "Y")
  80.                 {
  81.                     Console.WriteLine("Well lets start:");
  82.                 }
  83.                 else
  84.                 {
  85.                     Console.WriteLine("Please try again.");
  86.  
  87.                 }
  88.             }
  89.             //Instructions
  90.  
  91.  
  92.  
  93.             Console.WriteLine("LOADING...");
  94.  
  95.             Console.WriteLine("7%");
  96.             System.Threading.Thread.Sleep(200);
  97.             Console.WriteLine("26 %");
  98.             System.Threading.Thread.Sleep(100);
  99.             Console.WriteLine("48%");
  100.             System.Threading.Thread.Sleep(200);
  101.             Console.WriteLine("76%");
  102.             System.Threading.Thread.Sleep(600);
  103.             Console.WriteLine("87%");
  104.             System.Threading.Thread.Sleep(400);
  105.             Console.WriteLine("99%");
  106.             System.Threading.Thread.Sleep(20);
  107.             Console.WriteLine("100%");
  108.             //Loading...
  109.  
  110.             Console.WriteLine("Hey buddy, you took that hit pretty hard. Are you alright?");
  111.             Console.ReadLine();
  112.             Console.WriteLine("Well we need to get you to a hospital.\nSorry, what was your name?");
  113.             name = Console.ReadLine();
  114.             Console.WriteLine("Well " + name + ", I wish we were meeting under better circumstances.");
  115.             Console.WriteLine("Anyway, I'm Dave. Off to the East is a path that looks pretty safe, the only other direction is back to the west where I just found you. So we won't go there.");
  116.             Console.WriteLine("YOU MOVED EAST!!!");
  117.             xCord = xCord + 1;
  118.             //Intro
  119.  
  120.  
  121.             //GAMEPLAY
  122.             while (true)
  123.             {
  124.                 //1,0
  125.                 if (xCord == 1 && yCord == 0)
  126.                 {
  127.                     Console.WriteLine("Hit E then enter for testing.");
  128.                     response = Console.ReadLine();
  129.                     hastyped = !string.IsNullOrWhiteSpace(response);
  130.                     if (hastyped == true)
  131.                     {
  132.                         Move();
  133.                     }
  134.                 }
  135.  
  136.                 //2,0
  137.                 if (xCord == 2 && yCord == 0)
  138.                 {
  139.                     Console.WriteLine("It worked.");
  140.                 }
  141.  
  142.                 //3,0
  143.                 if (xCord == 3 && yCord == 0)
  144.                 {
  145.  
  146.                 }
  147.                 //-1,0
  148.                 if (xCord == -1 && yCord == 0)
  149.                 {
  150.  
  151.                 }
  152.  
  153.                 //-2,0
  154.                 if (xCord == -2 && yCord == 0)
  155.                 {
  156.  
  157.                 }
  158.  
  159.                 //-3,0
  160.                 if (xCord == -3 && yCord == 0)
  161.                 {
  162.  
  163.                 }
  164.  
  165.                 //1,1
  166.                 if (xCord == 1 && yCord == 1)
  167.                 {
  168.  
  169.                 }
  170.  
  171.                 //2,1
  172.                 if (xCord == 2 && yCord == 1)
  173.                 {
  174.  
  175.                 }
  176.  
  177.                 //3,1
  178.                 if (xCord == 3 && yCord == 1)
  179.                 {
  180.  
  181.                 }
  182.  
  183.                 //-1,1
  184.                 if (xCord == -1 && yCord == 1)
  185.                 {
  186.  
  187.                 }
  188.  
  189.                 //-2,1
  190.                 if (xCord == -2 && yCord == 1)
  191.                 {
  192.  
  193.                 }
  194.  
  195.                 //-3,1
  196.                 if (xCord == -3 && yCord == 1)
  197.                 {
  198.  
  199.                 }
  200.  
  201.                 //1,2
  202.                 if (xCord == 1 && yCord == 2)
  203.                 {
  204.  
  205.                 }
  206.  
  207.                 //2,2
  208.                 if (xCord == 2 && yCord == 2)
  209.                 {
  210.  
  211.                 }
  212.  
  213.                 //3,2
  214.                 if (xCord == 3 && yCord == 2)
  215.                 {
  216.  
  217.                 }
  218.  
  219.                 //-1,2
  220.                 if (xCord == -1 && yCord == 2)
  221.                 {
  222.  
  223.                 }
  224.  
  225.                 //-2,2
  226.                 if (xCord == -2 && yCord == 2)
  227.                 {
  228.  
  229.                 }
  230.  
  231.                 //-3,2
  232.                 if (xCord == -3 && yCord == 2)
  233.                 {
  234.  
  235.                 }
  236.  
  237.                 //1,3
  238.                 if (xCord == 1 && yCord == 3)
  239.                 {
  240.  
  241.                 }
  242.  
  243.                 //2,3
  244.                 if (xCord == 2 && yCord == 3)
  245.                 {
  246.  
  247.                 }
  248.  
  249.                 //3,3
  250.                 if (xCord == 3 && yCord == 3)
  251.                 {
  252.  
  253.                 }
  254.  
  255.                 //-1,3
  256.                 if (xCord == -1 && yCord == 3)
  257.                 {
  258.  
  259.                 }
  260.  
  261.                 //-2,3
  262.                 if (xCord == -2 && yCord == 3)
  263.                 {
  264.  
  265.                 }
  266.  
  267.                 //-3,3
  268.                 if (xCord == -3 && yCord == 3)
  269.                 {
  270.  
  271.                 }
  272.  
  273.                 //1,-1
  274.                 if(xCord == 1 && yCord == -1)
  275.                 {
  276.  
  277.                 }
  278.  
  279.                 //2,-1
  280.                 if (xCord == 2 && yCord == -1)
  281.                 {
  282.  
  283.                 }
  284.  
  285.                 //3,-1
  286.                 if (xCord == 3 && yCord == -1)
  287.                 {
  288.  
  289.                 }
  290.  
  291.                 //-1,-1
  292.                 if (xCord == -1 && yCord == -1)
  293.                 {
  294.  
  295.                 }
  296.  
  297.                 //-2,-1
  298.                 if (xCord == -2 && yCord == -1)
  299.                 {
  300.  
  301.                 }
  302.  
  303.                 //-3,-1
  304.                 if (xCord == -3 && yCord == -1)
  305.                 {
  306.  
  307.                 }
  308.  
  309.                 //1,-2
  310.                 if (xCord == 1 && yCord == -2)
  311.                 {
  312.  
  313.                 }
  314.  
  315.                 //2,-2
  316.                 if (xCord == 2 && yCord == -2)
  317.                 {
  318.  
  319.                 }
  320.  
  321.                 //3,-2
  322.                 if (xCord == 3 && yCord == -2)
  323.                 {
  324.  
  325.                 }
  326.  
  327.                 //-1,-2
  328.                 if (xCord == -1 && yCord == -2)
  329.                 {
  330.  
  331.                 }
  332.  
  333.                 //-2,-2
  334.                 if (xCord == -2 && yCord == -2)
  335.                 {
  336.  
  337.                 }
  338.  
  339.                 //-3,-2
  340.                 if (xCord == -3 && yCord == -2)
  341.                 {
  342.  
  343.                 }
  344.  
  345.                 //1,-3
  346.                 if (xCord == 1 && yCord == -3)
  347.                 {
  348.  
  349.                 }
  350.  
  351.                 //2,-3
  352.                 if (xCord == 2 && yCord == -3)
  353.                 {
  354.  
  355.                 }
  356.  
  357.                 //3,-3
  358.                 if (xCord == 3 && yCord == -3)
  359.                 {
  360.  
  361.                 }
  362.  
  363.                 //-1,-3
  364.                 if (xCord == -1 && yCord == -3)
  365.                 {
  366.  
  367.                 }
  368.  
  369.                 //-2,-3
  370.                 if (xCord == -2 && yCord == -3)
  371.                 {
  372.  
  373.                 }
  374.  
  375.                 //-3,-3
  376.                 if (xCord == -3 && yCord == -3)
  377.                 {
  378.  
  379.                 }
  380.  
  381.                 //0,3
  382.                 if (xCord == 0 && yCord == 3)
  383.                 {
  384.  
  385.                 }
  386.  
  387.                 //0,2
  388.                 if (xCord == 0 && yCord == 2)
  389.                 {
  390.  
  391.                 }
  392.  
  393.                 //0,1
  394.                 if (xCord == 0 && yCord == 1)
  395.                 {
  396.  
  397.                 }
  398.  
  399.                 //0,0
  400.                 if (xCord == 0 && yCord == 0)
  401.                 {
  402.  
  403.                 }
  404.  
  405.                 //0,-1
  406.                 if (xCord == 0 && yCord == -1)
  407.                 {
  408.  
  409.                 }
  410.  
  411.                 //0,-2
  412.                 if (xCord == 0 && yCord == -2)
  413.                 {
  414.  
  415.                 }
  416.  
  417.                 //0,-3
  418.                 if (xCord == 0 && yCord == -3)
  419.                 {
  420.  
  421.                 }
  422.  
  423.  
  424.  
  425.                 //BOUNDARIES:
  426.  
  427.  
  428.                 //RIGHT
  429.                 if (xCord == 4)
  430.                 {
  431.                     Console.WriteLine("This area doesn't exist.");
  432.                     xCord = xCord - 1;
  433.                 }
  434.  
  435.                 //LEFT
  436.                 if (xCord == -4)
  437.                 {
  438.                     Console.WriteLine("This area doesn't exist.");
  439.                     xCord = xCord + 1;
  440.                 }
  441.  
  442.                 //TOP
  443.                 if (yCord == 4)
  444.                 {
  445.                     Console.WriteLine("This area doesn't exist.");
  446.                     yCord = yCord - 1;
  447.                 }
  448.  
  449.                 //BOTTOM
  450.                 if (yCord == -4)
  451.                 {
  452.                     Console.WriteLine("This area doesn't exist.");
  453.                     yCord = yCord + 1;
  454.                 }
  455.  
  456.             }
  457.  
  458.         }
  459.     }
  460. }
  461.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement