Пример #1
0
        public static void Main(string[] args)
        {
            Console.BufferHeight  = Console.WindowHeight = 31;
            Console.BufferWidth   = Console.WindowWidth = 50;
            Console.CursorVisible = false;

            DrawDisplay d = new DrawDisplay();

            d.DrawRoad(screenHeight, screenWidth);

            Car car = new Car((screenWidth / 2) - Car.WIDTH / 2, screenHeight - Car.LENGTH);

            d.DrawCar(car);

            MoveGame(car);
        }
Пример #2
0
        public static void Main(string[] args)
        {
            Console.BufferHeight = Console.WindowHeight = 31;
            Console.BufferWidth  = Console.WindowWidth = 50;
            //Console.CursorVisible = false;
            //Console.SetBufferSize(50, 31);

            String title = "Console Application Car";

            Console.Title = title;
            while (!Console.KeyAvailable)
            {
                Console.BackgroundColor = ConsoleColor.Cyan;
                Console.Clear();
                Console.SetCursorPosition((Console.WindowWidth - title.Length) / 2, Console.WindowHeight / 2);
                Console.BackgroundColor = ConsoleColor.Gray;
                Console.ForegroundColor = ConsoleColor.DarkRed;
                Console.Write(title);
                Thread.Sleep(1500);

                Console.BackgroundColor = ConsoleColor.DarkCyan;
                Console.Clear();
                Console.SetCursorPosition((Console.WindowWidth - title.Length) / 2, Console.WindowHeight / 2);
                Console.BackgroundColor = ConsoleColor.DarkRed;
                Console.ForegroundColor = ConsoleColor.Gray;
                Console.Write(title);
                Thread.Sleep(1500);
            }
            Console.BackgroundColor = ConsoleColor.DarkMagenta;
            Console.Clear();


            Console.BufferHeight  = Console.WindowHeight = 31;
            Console.BufferWidth   = Console.WindowWidth = 50;
            Console.CursorVisible = false;

            DrawDisplay d = new DrawDisplay();

            d.DrawRoad(screenHeight, screenWidth);

            Car car = new Car((screenWidth / 2) - Car.WIDTH / 2, screenHeight - Car.LENGTH);

            d.DrawCar(car);

            MoveGame(car);
        }