Exemple #1
0
        static void Main(string[] args)
        {
            Program    test    = new Program();
            Paddle     p       = new Paddle(10);
            Ball       b       = new Ball();
            Display    display = new Display();
            ConsoleKey input   = Console.ReadKey().Key;


            Task.Run(async() =>
            {
                while (true)
                {
                    display.gameSpace(25, 20, b, p);
                    await Task.Delay(150);
                }
            });

            while (true)
            {
                input = Console.ReadKey().Key;

                if (input == ConsoleKey.UpArrow)
                {
                    p.movePadUp();
                }

                if (input == ConsoleKey.DownArrow)
                {
                    p.movePadDown();
                }
            }
        }