示例#1
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(60, 40);
            Console.SetBufferSize(60, 40);

            //Square sq = new Square(1, 1, 'x');
            //Figure myFigyre;
            FigureGenerator generator  = new FigureGenerator(5, 5, '*');
            Figure          currFigure = generator.GetNewFigure();

            while (true)
            {
                if (Console.KeyAvailable)
                {
                    var key = Console.ReadKey();
                    HandleKey(key, currFigure);
                }
            }



            void FigureFall(Figure myFigure)
            {
                for (int i = 0; i < 10; i++)
                {
                    myFigure.Draw();
                    Thread.Sleep(200);
                    myFigure.Hide();
                    myFigure.Move(Wasd.DOWN);
                }
            }

            Console.Read();
        }
示例#2
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(Field.Width, Field.Height);
            Console.SetBufferSize(Field.Width, Field.Height);

            Field.Width = 60;

            FigureGenerator generator     = new FigureGenerator(20, 0, '*');
            Figure          currentFigure = generator.GetNewFigure();

            while (true)
            {
                if (Console.KeyAvailable)
                {
                    ConsoleKeyInfo key = Console.ReadKey();
                    HandleKey(currentFigure, key);
                }
            }
        }