コード例 #1
0
    public static void Main()
    {
        ConsoleKeyInfo key;
        bool           finished = false;
        Fishes         myFish   = new Fishes();
        Environment    myEnv    = new Environment();
        Coral          myCoral  = new Coral();
        SeaWeed        myWeed   = new SeaWeed();
        Rocks          myRock   = new Rocks();
        Bubbles        myBubble = new Bubbles();

        while (!finished)
        {
            Console.Clear();

            myFish.Draw();
            myFish.Move();

            myEnv.Draw();
            myCoral.Draw();
            myWeed.Draw();
            myRock.Draw();
            myBubble.Draw();

            Thread.Sleep(100);

            if (Console.KeyAvailable)
            {
                key = Console.ReadKey();
                if (key.Key == ConsoleKey.Escape)
                {
                    finished = true;
                }
            }
        }

        Console.Clear();
        Console.SetCursorPosition(35, 12);
        Console.ForegroundColor = ConsoleColor.White;
        Console.WriteLine("Bye Bye!");
        Console.ReadKey();
    }