Example #1
0
        // If user selects a Canine character, the computer will randomly select a Feline character to play as.
        public static object ComputerFeline()
        {
            Random rand   = new Random();
            int    random = rand.Next(1, 4);

            if (random == 1)
            {
                Console.WriteLine("\n");
                Console.BackgroundColor = ConsoleColor.DarkGreen;
                Console.WriteLine("YOU'RE PLAYING AGAINST FERAL CAT BOT!");
                Console.ResetColor();
                Console.WriteLine("\n");
                FeralCat newFeralCat = new FeralCat("Feral Cat Bot");
                return(newFeralCat);
            }
            else if (random == 2)
            {
                Console.WriteLine("\n");
                Console.BackgroundColor = ConsoleColor.DarkGreen;
                Console.WriteLine("YOU'RE PLAYING AGAINST CHEETAH BOT!");
                Console.ResetColor();
                Console.WriteLine("\n");
                Cheetah newCheetah = new Cheetah("Cheetah Bot");
                return(newCheetah);
            }
            else
            {
                Console.WriteLine("\n");
                Console.BackgroundColor = ConsoleColor.DarkGreen;
                Console.WriteLine("YOU'RE PLAYING AGAINST TIGER BOT!");
                Console.ResetColor();
                Console.WriteLine("\n");
                Tiger newTiger = new Tiger("Tiger Bot");
                return(newTiger);
            }
        }
Example #2
0
        // Ask user for their character and name choice.
        public static object CreateUser()
        {
            Console.ForegroundColor = ConsoleColor.DarkYellow;
            Console.WriteLine("What class do you want to be?");
            Console.WriteLine("SELECT (CANINE): '1' for Wolf, '2' for Hyena, '3' for Husky.");
            Console.WriteLine("SELECT (FELINE): '4' for Tiger, '5' for Cheetah, '6' for Feral Cat.");
            Console.WriteLine("Type 'Quit' to quit game");
            Console.ResetColor();

            string userClass = Console.ReadLine();

            if (userClass == "Quit")
            {
                QuitGame();
                return(null);
            }

            Console.ForegroundColor = ConsoleColor.DarkYellow;
            Console.WriteLine("What do you want your character's name to be?");
            Console.ResetColor();

            string userName = Console.ReadLine();

            if (userName == "Quit")
            {
                QuitGame();
                return(null);
            }

            switch (userClass)
            {
            case "1":
                Wolf newWolf = new Wolf(userName);
                return(newWolf);

            case "2":
                Hyena newHyena = new Hyena(userName);
                return(newHyena);

            case "3":
                Husky newHusky = new Husky(userName);
                return(newHusky);

            case "4":
                Tiger newTiger = new Tiger(userName);
                return(newTiger);

            case "5":
                Cheetah newCheetah = new Cheetah(userName);
                return(newCheetah);

            case "6":
                FeralCat newFeralCat = new FeralCat(userName);
                return(newFeralCat);

            default:
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("NOT AN OPTION.");
                Console.ResetColor();
                StartGame();
                return(null);
            }
        }