Advertisement
WebMeh

my basic game part 2

Mar 29th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.27 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication4
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.  
  13.             //my basic game to learn some coding
  14.             Random numberGenerator = new Random();
  15.             string pricelist = "the prices: shield = 20g sword = 48g a bow is 40g arrows are 20g";
  16.             int hp = 100;
  17.             int mobhp = 200;
  18.             int gold = 100;
  19.             string sword = "sword";
  20.             string shield = "shield";
  21.             string bows = "bow";
  22.             string arrows = "arrow";
  23.             string kick = "kick";
  24.             string slash = "slash";
  25.             string punch = "punch";
  26.             string dodge = "dodge";
  27.             string shoot = "shoot";
  28.             string run = "run";
  29.             string heal = "heal";
  30.             string yes = "yes";
  31.             string no = "no";
  32.             string answer;
  33.             string name;
  34.             string shop = "shop";
  35.             string battle = "battle";
  36.             string moves = "kick shoot dodge run heal slash type what you wanna do: ";
  37.  
  38.  
  39.             Console.WriteLine("welcome in the virtual world of pixel");
  40.             Console.Write("\n If you wanna start in this World write yes: ");
  41.             answer = Convert.ToString(Console.ReadLine());
  42.             if (answer == yes)
  43.             {
  44.                 Console.Clear();
  45.                 Console.WriteLine("welcome to Pixel");
  46.                 Console.Write("\n What is the name of your character ?: ");
  47.                 name = Convert.ToString(Console.ReadLine());
  48.                 Console.Write(name + " you wanna go to the shop first ? type shop for battle type battle: ");
  49.                 answer = Convert.ToString(Console.ReadLine());
  50.             }
  51.        
  52.             if (answer == battle){
  53.            
  54.                 Console.Write(moves);
  55.                 answer = Convert.ToString(Console.ReadLine());
  56.             }
  57.             if (answer == kick)
  58.             {
  59.                 Console.Clear();
  60.                 {
  61.                     while (mobhp != 85)
  62.  
  63.  
  64.  
  65.                         mobhp -= 15;
  66.                    
  67.                     Console.WriteLine("Fighting");
  68.                     Console.Clear();
  69.                     Console.WriteLine(hp - numberGenerator.Next(1, 7));
  70.                     hp = Convert.ToInt32(Console.ReadLine());
  71.                     Console.WriteLine("you got " + hp + "left");
  72.                     Console.Write(moves);
  73.                     Console.ReadLine();
  74.                 }
  75.                 if (hp == 0)
  76.                 {
  77.                     Console.WriteLine("you've been defeated");
  78.                     Console.ReadLine();
  79.                 }
  80.                 else if (mobhp == 0)
  81.                 {
  82.                     Console.WriteLine("you sucesfully destroyed the beast");
  83.                     Console.ReadLine();
  84.                 }
  85.  
  86.             }
  87.             if (answer == shoot)
  88.             {
  89.                 Console.Clear();
  90.                 mobhp -= numberGenerator.Next(50, 100);
  91.                 Console.WriteLine(" the mob has " + mobhp  + "left");
  92.                 Console.ReadLine()
  93.                     if (mobhp = 0){
  94.                         Console.WriteLine("u killed the mob")
  95.                     }
  96.  
  97.             if (answer == shop)
  98.             {
  99.            
  100.                 Console.Clear();
  101.             shop:      
  102.                 Console.WriteLine("you got 100 gold");
  103.                 Console.WriteLine(pricelist);
  104.                 Console.Write("to buy a shield type shield to buy a sword type sword   to buy a bow type bow tobuy 10 arrows type arrow:  \n ");
  105.                 answer = Convert.ToString(Console.ReadLine());
  106.            
  107.  
  108.             if (answer == sword)
  109.             {
  110.                 Console.Clear();
  111.  
  112.                 {
  113.                     while (gold != 52)
  114.  
  115.                         gold -= 10;
  116.                     Console.WriteLine("you got " + gold + " gold left");
  117.                    
  118.                 }
  119.    
  120.             }
  121.             else if (answer == arrows)
  122.             {
  123.                 Console.Clear();
  124.                 {
  125.                     while (gold != 80)
  126.                         gold -= 10;
  127.  
  128.                     Console.WriteLine("you got " + gold + " gold left");
  129.                    
  130.                 }
  131.      
  132.             }
  133.             else if (answer == shield)
  134.             {
  135.                 Console.Clear();
  136.                 {
  137.                     while (gold != 80)
  138.  
  139.                         gold -= 10;
  140.  
  141.                     Console.WriteLine("you got " + gold + " gold left");
  142.                    
  143.                 }
  144.  
  145.             }
  146.  
  147.             else if (answer == bows)
  148.             {
  149.                 Console.Clear();
  150.                 {
  151.                     while (gold != 60) ;
  152.                     gold -= 10;
  153.  
  154.                     Console.WriteLine("you got " + gold + " gold left");
  155.        
  156.                 }
  157.          
  158.            
  159.             }
  160.             }
  161.            
  162.              
  163.                
  164.            
  165.  
  166.  
  167.  
  168.  
  169.             //battle part moet nog afgemaakt worden
  170.             //move sets moeten nog afgemaakt worden
  171.             //extra mobs moeten geadd worden
  172.  
  173.  
  174.         }
  175.     }
  176. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement