Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication4
- {
- class Program
- {
- static void Main(string[] args)
- {
- //my basic game to learn some coding
- Random numberGenerator = new Random();
- string pricelist = "the prices: shield = 20g sword = 48g a bow is 40g arrows are 20g";
- int hp = 100;
- int mobhp = 200;
- int gold = 100;
- string sword = "sword";
- string shield = "shield";
- string bows = "bow";
- string arrows = "arrow";
- string kick = "kick";
- string slash = "slash";
- string punch = "punch";
- string dodge = "dodge";
- string shoot = "shoot";
- string run = "run";
- string heal = "heal";
- string yes = "yes";
- string no = "no";
- string answer;
- string name;
- string shop = "shop";
- string battle = "battle";
- string moves = "kick shoot dodge run heal slash type what you wanna do: ";
- Console.WriteLine("welcome in the virtual world of pixel");
- Console.Write("\n If you wanna start in this World write yes: ");
- answer = Convert.ToString(Console.ReadLine());
- if (answer == yes)
- {
- Console.Clear();
- Console.WriteLine("welcome to Pixel");
- Console.Write("\n What is the name of your character ?: ");
- name = Convert.ToString(Console.ReadLine());
- Console.Write(name + " you wanna go to the shop first ? type shop for battle type battle: ");
- answer = Convert.ToString(Console.ReadLine());
- }
- if (answer == battle){
- Console.Write(moves);
- answer = Convert.ToString(Console.ReadLine());
- }
- if (answer == kick)
- {
- Console.Clear();
- {
- while (mobhp != 85)
- mobhp -= 15;
- Console.WriteLine("Fighting");
- Console.Clear();
- Console.WriteLine(hp - numberGenerator.Next(1, 7));
- hp = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("you got " + hp + "left");
- Console.Write(moves);
- Console.ReadLine();
- }
- if (hp == 0)
- {
- Console.WriteLine("you've been defeated");
- Console.ReadLine();
- }
- else if (mobhp == 0)
- {
- Console.WriteLine("you sucesfully destroyed the beast");
- Console.ReadLine();
- }
- }
- if (answer == shoot)
- {
- Console.Clear();
- mobhp -= numberGenerator.Next(50, 100);
- Console.WriteLine(" the mob has " + mobhp + "left");
- Console.ReadLine()
- if (mobhp = 0){
- Console.WriteLine("u killed the mob")
- }
- if (answer == shop)
- {
- Console.Clear();
- shop:
- Console.WriteLine("you got 100 gold");
- Console.WriteLine(pricelist);
- 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 ");
- answer = Convert.ToString(Console.ReadLine());
- if (answer == sword)
- {
- Console.Clear();
- {
- while (gold != 52)
- gold -= 10;
- Console.WriteLine("you got " + gold + " gold left");
- }
- }
- else if (answer == arrows)
- {
- Console.Clear();
- {
- while (gold != 80)
- gold -= 10;
- Console.WriteLine("you got " + gold + " gold left");
- }
- }
- else if (answer == shield)
- {
- Console.Clear();
- {
- while (gold != 80)
- gold -= 10;
- Console.WriteLine("you got " + gold + " gold left");
- }
- }
- else if (answer == bows)
- {
- Console.Clear();
- {
- while (gold != 60) ;
- gold -= 10;
- Console.WriteLine("you got " + gold + " gold left");
- }
- }
- }
- //battle part moet nog afgemaakt worden
- //move sets moeten nog afgemaakt worden
- //extra mobs moeten geadd worden
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement