Example #1
0
        /*
         * Инициализация координат
         */
        private static void InitCoordinates()
        {
            var max = GetMaxStringLength();

            startX = (Measurements.GetWindowSizeX() / 2) - (max / 2);
            startY = (Measurements.GetWindowSizeY() / 2) - (length / 2);
        }
Example #2
0
        /*
         * Вывод имени (псевдонима) автора игры
         */
        private static void WriteAuthor()
        {
            var phrase = "Written by: SoloLev 2019";
            var start  = (Measurements.GetPreviewSizeX() / 2) - (phrase.Length / 2);

            Console.SetCursorPosition(start, Measurements.GetWindowSizeY() - 1);
            Console.Write(phrase);
        }
Example #3
0
        /*
         * Вывод предложения для продолжения
         */
        private static void WriteSuggstionForContinue()
        {
            var phrase = "Press any key for continue...";
            var start  = (Measurements.GetWindowSizeX() / 2) - (phrase.Length / 2);

            Console.SetCursorPosition(start, Measurements.GetWindowSizeY() - 3);
            Console.Write(phrase);
        }
        /*
         * Вывод предложения продолжить
         */
        private static void WriteSuggestionToContinue()
        {
            var phrase = "Press enter for continue...";

            Console.SetCursorPosition(
                (Measurements.GetWindowSizeX() / 2) - (phrase.Length / 2),
                (Measurements.GetWindowSizeY() - 1));
            Console.Write(phrase);

            Console.ReadKey();
        }
Example #5
0
 /*
  * Установка размеров окна
  *
  * NOTE: если убрать, две посление строчки,
  * то все будет не правильно отображаться
  */
 private static void SetWindowSize()
 {
     Console.WindowWidth  = Measurements.GetWindowSizeX();
     Console.WindowHeight = Measurements.GetWindowSizeY();
     Console.WindowTop    = 0;
     Console.WindowLeft   = 0;
     Console.BufferWidth  = Measurements.GetWindowSizeX();
     Console.BufferHeight = Measurements.GetWindowSizeY();
     Console.WindowWidth  = Measurements.GetWindowSizeX();
     Console.WindowHeight = Measurements.GetWindowSizeY();
 }
Example #6
0
        /*
         * Вывод поля на экран
         */
        private static void Write()
        {
            Console.Clear();

            for (int y = 0; y < Measurements.GetWindowSizeY(); y++)
            {
                for (int x = 0; x < Measurements.GetWindowSizeX(); x++)
                {
                    Console.BackgroundColor = field[x, y];
                    Console.SetCursorPosition(x, y);
                    Console.Write(" ");
                }
            }

            Console.BackgroundColor = ConsoleColor.Black;
        }
Example #7
0
        public static void WritePlayersName(bool isMultiplayer)
        {
            Console.SetCursorPosition(Measurements.GetWindowSizeX() - 1 - player.Length, 1);
            Console.Write(player);

            if (isMultiplayer)
            {
                Console.SetCursorPosition(1, 1);
                Console.Write(player);
            }
            else
            {
                Console.SetCursorPosition(1, 1);
                Console.Write(computer);
            }

            Console.SetCursorPosition(Measurements.GetWindowSizeX() / 2, Measurements.GetWindowSizeY() - 2);
        }