Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Game v 1.0
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Game_attempt { class Program { static void Main(string[] args) { player _player = new player(); optionMenu menu = new optionMenu(); town Fajira = new town(); town Urok = new town(); town Tibhut = new town(); town Selvestia = new town(); town StormStead = new town(); town Faurester = new town(); town Malven = new town(); menu.Option(menu, _player); } public class player { private string playerLocation; private string playerName; private double playerMaxHealth; private double playerHealth; private int exp; private int lvl; private double gold; //NAME public void setPlayerName(string name) { playerName = name; } public string getPlayerName() { return playerName; } //LOCATION public void setPlayerLocation(string location) { playerLocation = location; } public string getPLayerLocation() { return playerLocation; } //HEALTH public void setPlayerHealth(double Health) { playerHealth = Health; } public double getPlayerHealth() { return playerHealth; } public void setPlayerGold(double _gold) { gold = _gold; } } public class optionMenu { public void Option(optionMenu menu, player _player) { string name; string name1; Console.WriteLine("What is your name?"); name = Console.ReadLine(); _player.setPlayerName(name); name1 = _player.getPlayerName(); Console.WriteLine("Welcome {0}" ,name1); string num; Console.WriteLine("What do you want to do? go to a location[A] "); num = Console.ReadLine(); //LOCATION if (num == "A") { string loc; Console.WriteLine("Where do you want to go?"); Console.WriteLine("Fajira, Urok, Tibhut, Selvestia, StormStead, Faurester or Malven"); loc = Console.ReadLine(); if (loc == "A") // FAJIRA { string loc2; string fajira = "Fajira"; _player.setPlayerLocation(fajira); loc2 = _player.getPLayerLocation(); Console.WriteLine("Welcome to : {0}" ,loc2); } //Urok else if (loc == "B") { _player.setPlayerLocation("Urok"); } //Tibhut else if (loc == "C") { _player.setPlayerLocation("Tibhut"); } //Selvestia else if (loc == "D") { _player.setPlayerLocation("Selvestia"); } else if (loc == "E") { _player.setPlayerLocation("Stormstead"); } else if (loc == "F") { _player.setPlayerLocation("Faurester"); } else if (loc == "G") { _player.setPlayerLocation("Malven"); } // } else if (num == "B") { } } } public class town { } } }
run
|
edit
|
history
|
help
0
Read XML nodes into Data Dictionary
Collections
My world
Added Carnival, List Matching
First pr
BiologyQuestions
AdventCode
Hack
Z_non_pow
23