示例#1
0
    public void Play()
    {
        switch (toEnum)
        {
        case GameStatusBase.GameStates.Start:
            Console.WriteLine("To Continue: Play, End");
            gameFunction = Console.ReadLine();
            Console.WriteLine(gameFunction);
            if (Enum.TryParse(gameFunction, out toEnum))
            {
                Console.WriteLine(toEnum);
            }
            Play();

            break;

        case GameStatusBase.GameStates.End:
            Console.WriteLine("Game Over");
            Environment.Exit(0);
            break;

        case GameStatusBase.GameStates.Play:
            Level.enter();
            Level.Spot(2);
            while (Game.canPlay)
            {
                GameTimer();
                Play();
            }
            Play();
            break;

        case GameStatusBase.GameStates.Died:
            Console.WriteLine("You Died");
            Console.WriteLine("Game Over");
            break;

        default:
            Console.WriteLine("This is not a valid option");
            Play();
            break;
        }
        Random randomNum = new Random();

        Level.Spot(randomNum.Next(0, Level.Enemies.Length));
    }