Advertisement
PhotoShaman

Doors OS v1.03

Sep 8th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 64.95 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading;
  4.  
  5. namespace ConsoleApplication65
  6. {
  7.     class Program
  8.     {
  9.         private static int x, y, timeStart, xBox, yBox, xPBox, yPBox, color,
  10.                             ballPosX, ballPosY, playerPos, botPos, playerpadSize,
  11.                             botpadSize, playerResult, botResult, botLvlHard, ballSlow,
  12.                             xPosPlayer, yPosPlayer, jumpHeight, playerHealth, nextLvlNumber;
  13.  
  14.         private static bool StartOpen, FolderOpen, DrawingOpen, Drawing, SaveOrLoadOpen, ExitOpen, SaveDrawing, PingPongOpen, PlatformerOpen,
  15.                             ballDirectionUp, ballDirectionRight, playerDirectionRight, canJump, playerJump, isGrounded, otherGravity, pauseOpen,
  16.                             Image1Save = false, Image2Save = false, Image3Save = false, Kitty = false, ToUpDate = true;
  17.  
  18.         private static int[,] image, AnimationSettins1, AnimationSettins2;
  19.         private static int[,] DrawingSaveMain = new int[18, 52];
  20.         private static int[,] DrawingSave1, DrawingSave2, DrawingSave3 = new int[18, 52];
  21.  
  22.         private static List<string> botsName;
  23.  
  24.         static Random randomGenerator = new Random();
  25.  
  26.         #region Основа
  27.  
  28.         private static void Main()
  29.         {
  30.             Settings();
  31.             LoadingDraw();
  32.             OperatingSystem();
  33.         }
  34.  
  35.         private static void Settings()
  36.         {
  37.             timeStart = TimeCheck();
  38.             if (timeStart > 58)
  39.             {
  40.                 timeStart = -1;
  41.             }
  42.             StartOpen = false;
  43.             FolderOpen = false;
  44.             DrawingOpen = false;
  45.             PingPongOpen = false;
  46.             ExitOpen = false;
  47.             color = 1;
  48.  
  49.             Console.SetWindowSize(120, 30);
  50.             Console.BufferHeight = Console.WindowHeight;
  51.             Console.BufferWidth = Console.WindowWidth;
  52.             Console.Title = "Doors OS";
  53.  
  54.             x = 2;
  55.             y = Console.WindowHeight - 5;
  56.  
  57.             ResetDrawingSaveMain();
  58.         }
  59.  
  60.         private static void ResetDrawingSaveMain()
  61.         {
  62.             for (int i = 0; i <= 17; i++)
  63.             {
  64.                 for (int j = 0; j <= 50; j++)
  65.                 {
  66.                     DrawingSaveMain[i, j] = 15;
  67.                 }
  68.                 DrawingSaveMain[i, 51] = 0;
  69.             }
  70.         }
  71.  
  72.         private static int TimeCheck()
  73.         {
  74.             int timeReturn;
  75.             string curTimeShort = DateTime.Now.ToString("mm");
  76.             timeReturn = Convert.ToInt32(curTimeShort);
  77.             return timeReturn;
  78.         }
  79.  
  80.         private static void LoadingAnimationSettings()
  81.         {
  82.             AnimationSettins1 = new int[,]
  83.                 {
  84.                 {1,1,10,5,45,7,0},
  85.                 {0,2,10,5,65,7,0},
  86.                 {0,3,10,5,45,17,0},
  87.                 {0,4,10,5,65,17,200},
  88.                 {1,1,10,5,47,8,0},
  89.                 {0,2,10,5,63,8,0},
  90.                 {0,3,10,5,47,16,0},
  91.                 {0,4,10,5,63,16,300},
  92.                 {1,1,10,5,50,10,0},
  93.                 {0,2,10,5,60,10,0},
  94.                 {0,3,10,5,50,15,0},
  95.                 {0,4,10,5,60,15,300},
  96.                 {1,1,10,10,50,5,0},
  97.                 {0,2,10,10,60,5,0},
  98.                 {0,3,10,10,50,15,0},
  99.                 {0,4,10,10,60,15,300},
  100.                 {1,1,10,10,50,5,0},
  101.                 {0,2,10,10,60,5,0},
  102.                 {0,4,10,10,60,15,0},
  103.                 {0,3,15,15,50,10,200},
  104.                 {1,3,20,20,50,5,200},
  105.                 {0,5,2,1,65,15,0}
  106.                 };
  107.             AnimationSettins2 = new int[,]
  108.                 {
  109.                 {1,34,13,100},
  110.                 {2,46,13,100},
  111.                 {2,56,13,100},
  112.                 {3,66,13,100},
  113.                 {4,76,13,100},
  114.                 {2,88,13,100},
  115.                 {4,98,13,2000}
  116.                 };
  117.         }
  118.  
  119.         private static void LoadingDraw()
  120.         {
  121.             Console.CursorVisible = false;
  122.  
  123.             LoadingAnimationSettings();
  124.  
  125.             for (int p = 0; p <= 21; p++)
  126.             {
  127.                 if (AnimationSettins1[p, 0] == 1)
  128.                 {
  129.                     Console.ResetColor();
  130.                     Console.Clear();
  131.                 }
  132.                 if (AnimationSettins1[p, 1] == 1)
  133.                 {
  134.                     Console.BackgroundColor = ConsoleColor.Red;
  135.                 }
  136.                 if (AnimationSettins1[p, 1] == 2)
  137.                 {
  138.                     Console.BackgroundColor = ConsoleColor.Green;
  139.                 }
  140.                 if (AnimationSettins1[p, 1] == 3)
  141.                 {
  142.                     Console.BackgroundColor = ConsoleColor.Blue;
  143.                 }
  144.                 if (AnimationSettins1[p, 1] == 4)
  145.                 {
  146.                     Console.BackgroundColor = ConsoleColor.Yellow;
  147.                 }
  148.                 if (AnimationSettins1[p, 1] == 5)
  149.                 {
  150.                     Console.BackgroundColor = ConsoleColor.Black;
  151.                 }
  152.                 xBox = AnimationSettins1[p, 2];
  153.                 yBox = AnimationSettins1[p, 3];
  154.                 xPBox = AnimationSettins1[p, 4];
  155.                 yPBox = AnimationSettins1[p, 5];
  156.                 Box(xBox, yBox, xPBox, yPBox);
  157.                 Thread.Sleep(AnimationSettins1[p, 6]);
  158.             }
  159.  
  160.             for (int i = 1; i <= 40; i++)
  161.             {
  162.                 Console.ResetColor();
  163.                 Console.Clear();
  164.                 Console.BackgroundColor = ConsoleColor.Blue;
  165.                 Box(20, 20, (Console.WindowWidth / 2) - 10 - i, (Console.WindowHeight / 2) - 10);
  166.                 Console.BackgroundColor = ConsoleColor.Black;
  167.                 Box(2, 1, (Console.WindowWidth / 2) + 5 - i, Console.WindowHeight / 2);
  168.                 Thread.Sleep(10);
  169.             }
  170.  
  171.             for (int p = 0; p <= 6; p++)
  172.             {
  173.                 ChooseImage(AnimationSettins2[p, 0]);
  174.                 DrawImage(AnimationSettins2[p, 1], AnimationSettins2[p, 2]);
  175.                 Thread.Sleep(AnimationSettins2[p, 3]);
  176.             }
  177.  
  178.             Console.CursorVisible = true;
  179.  
  180.         }
  181.  
  182.         private static void Box(int Width, int Height, int XPos, int YPos)
  183.         {
  184.             for (int i = 0; i < Height; i++)
  185.             {
  186.                 Console.SetCursorPosition(XPos, YPos);
  187.                 Console.Write(" ".PadRight(Width));
  188.                 YPos++;
  189.             }
  190.         }
  191.  
  192.         private static void DrawImage(int m, int n)
  193.         {
  194.             Console.ResetColor();
  195.  
  196.             Console.SetCursorPosition(m, n);
  197.  
  198.             for (int i = 0; i < image.GetLength(0); i++)
  199.             {
  200.                 for (int j = 0; j < image.GetLength(1); j++)
  201.                 {
  202.                     if (image[i, j] == 0)
  203.                     {
  204.                         n++;
  205.                         Console.SetCursorPosition(m, n);
  206.                     }
  207.                     else if (image[i, j] > 0)
  208.                     {
  209.                         ChooseColor(image[i, j]);
  210.                         Console.Write("  ");
  211.                     }
  212.                 }
  213.             }
  214.             Console.SetCursorPosition(0, 0);
  215.         }
  216.  
  217.         private static void ChooseColor(int number)
  218.         {
  219.             //Знаю, что не хорошо так записывать if'ы, но так красивее и выходит меньше строчек..
  220.             if (number == 1) Console.BackgroundColor = ConsoleColor.Black;
  221.             if (number == 2) Console.BackgroundColor = ConsoleColor.Blue;
  222.             if (number == 3) Console.BackgroundColor = ConsoleColor.Cyan;
  223.             if (number == 4) Console.BackgroundColor = ConsoleColor.DarkBlue;
  224.             if (number == 5) Console.BackgroundColor = ConsoleColor.DarkCyan;
  225.             if (number == 6) Console.BackgroundColor = ConsoleColor.DarkGray;
  226.             if (number == 7) Console.BackgroundColor = ConsoleColor.DarkGreen;
  227.             if (number == 8) Console.BackgroundColor = ConsoleColor.DarkMagenta;
  228.             if (number == 9) Console.BackgroundColor = ConsoleColor.DarkRed;
  229.             if (number == 10) Console.BackgroundColor = ConsoleColor.DarkYellow;
  230.             if (number == 11) Console.BackgroundColor = ConsoleColor.Gray;
  231.             if (number == 12) Console.BackgroundColor = ConsoleColor.Green;
  232.             if (number == 13) Console.BackgroundColor = ConsoleColor.Magenta;
  233.             if (number == 14) Console.BackgroundColor = ConsoleColor.Red;
  234.             if (number == 15) Console.BackgroundColor = ConsoleColor.White;
  235.             if (number == 16) Console.BackgroundColor = ConsoleColor.Yellow;
  236.         }
  237.  
  238.         private static void ChooseImage(int i)
  239.         {
  240.             if (i == 0)
  241.             {
  242.                 if (Kitty)
  243.                 {
  244.                     image = new int[,] //Kitty
  245.                     {
  246.                 {2 ,1 ,1 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,1 ,1 ,2 ,2 ,0},
  247.                 {2 ,1 ,11,1 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,1 ,11,11,1 ,2 ,0},
  248.                 {2 ,1 ,11,11,1 ,2 ,2 ,2 ,2 ,2 ,1 ,11,11,11,1 ,2 ,0},
  249.                 {2 ,1 ,11,11,11,1 ,1 ,1 ,1 ,1 ,11,11,11,11,1 ,2 ,0},
  250.                 {1 ,11,11,11,11,11,11,11,11,11,11,11,11,11,1 ,2 ,0},
  251.                 {1 ,11,11,11,11,11,11,11,11,11,11,11,11,11,1 ,2 ,0},
  252.                 {1 ,11,11,11,11,11,11,11,11,11,11,11,11,11,11,1 ,0},
  253.                 {1 ,11,11,11,15,1 ,11,11,11,11,11,15,1 ,11,11,1 ,0},
  254.                 {1 ,11,11,11,1 ,1 ,11,11,11,1 ,11,1 ,1 ,11,11,1 ,0},
  255.                 {1 ,11,9 ,9 ,11,11,11,11,11,11,11,11,11,9 ,9 ,1 ,0},
  256.                 {1 ,11,9 ,9 ,11,1 ,11,11,1 ,11,11,1 ,11,9 ,9 ,1 ,0},
  257.                 {2 ,1 ,11,11,11,11,1 ,1 ,11,1 ,1 ,11,11,11,1 ,2 ,0},
  258.                 {2 ,2 ,1 ,11,11,11,11,11,11,11,11,11,11,1 ,2 ,2 ,0},
  259.                 {2 ,2 ,2 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,2 ,2 ,2 ,0}
  260.                     };
  261.                 }
  262.                 else
  263.                 {
  264.                     image = new int[,] //Mario
  265.             {
  266.                 {2 ,2 ,2 ,14,14,14,14,14,2 ,2 ,2 ,2 ,0},
  267.                 {2 ,2 ,14,14,14,14,14,14,14,14,14,2 ,0},
  268.                 {2 ,2 ,9 ,9 ,9 ,15,15,1 ,15,2 ,2 ,2 ,0},
  269.                 {2 ,9 ,15,9 ,15,15,15,1 ,15,15,15,2 ,0},
  270.                 {2 ,9 ,15,9 ,9 ,15,15,15,9 ,15,15,15,0},
  271.                 {2 ,9 ,9 ,15,15,15,15,9 ,9 ,9 ,9 ,2 ,0},
  272.                 {2 ,2 ,2 ,15,15,15,15,15,15,15,2 ,2 ,0},
  273.                 {2 ,2 ,14,14,4 ,14,14,14,2 ,2 ,2 ,2 ,0},
  274.                 {2 ,14,14,14,4 ,14,14,4 ,14,14,14,2 ,0},
  275.                 {14,14,14,14,4 ,4 ,4 ,4 ,14,14,14,14,0},
  276.                 {15,15,14,4 ,16,4 ,4 ,16,4 ,14,15,15,0},
  277.                 {15,15,15,4 ,4 ,4 ,4 ,4 ,4 ,15,15,15,0},
  278.                 {15,15,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,15,15,0},
  279.                 {2 ,2 ,4 ,4 ,4 ,2 ,2 ,4 ,4 ,4 ,2 ,2 ,0},
  280.                 {2 ,9 ,9 ,9 ,2 ,2 ,2 ,2 ,9 ,9 ,9 ,2 ,0},
  281.                 {9 ,9 ,9 ,9 ,2 ,2 ,2 ,2 ,9 ,9 ,9 ,9 ,0}
  282.             };
  283.                 }
  284.             }
  285.             if (i == 1)
  286.             {
  287.                 image = new int[,]
  288.                 {
  289.                 {15,15,15,15,1 ,0},
  290.                 {15,1 ,1 ,1 ,15,0},
  291.                 {15,1 ,1 ,1 ,15,0},
  292.                 {15,1 ,1 ,1 ,15,0},
  293.                 {15,15,15,15,1 ,0},
  294.                 };
  295.             }
  296.             if (i == 2)
  297.             {
  298.                 image = new int[,]
  299.                 {
  300.                 {15,15,15,15,0},
  301.                 {15,1 ,1 ,15,0},
  302.                 {15,1 ,1 ,15,0},
  303.                 {15,1 ,1 ,15,0},
  304.                 {15,15,15,15,0},
  305.                 };
  306.             }
  307.             if (i == 3)
  308.             {
  309.                 image = new int[,]
  310.                 {
  311.                 {15,15,15,15,0},
  312.                 {15,1 ,1 ,15,0},
  313.                 {15,15,15,15,0},
  314.                 {15,1 ,15,1 ,0},
  315.                 {15,1 ,15,1 ,0},
  316.                 };
  317.             }
  318.             if (i == 4)
  319.             {
  320.                 image = new int[,]
  321.                 {
  322.                 {15,15,15,0},
  323.                 {15,1 ,1 ,0},
  324.                 {15,15,15,0},
  325.                 {1 ,1 ,15,0},
  326.                 {15,15,15,0},
  327.                 };
  328.             }
  329.             if (i == 5)
  330.             {
  331.                 image = new int[,]
  332.                 {
  333.                 {1 ,0},
  334.                 {2 ,0},
  335.                 {3 ,0},
  336.                 {4 ,0},
  337.                 {5 ,0},
  338.                 {6 ,0},
  339.                 {7 ,0},
  340.                 {8 ,0},
  341.                 {9 ,0},
  342.                 {10,0},
  343.                 {11,0},
  344.                 {12,0},
  345.                 {13,0},
  346.                 {14,0},
  347.                 {15,0},
  348.                 {16,0}
  349.                 };
  350.             }
  351.             if (i == 6)
  352.             {
  353.                 image = DrawingSaveMain;
  354.             }
  355.             if (i == 7) //map 1
  356.             {
  357.                 image = new int[,]
  358.                 {
  359.                 {6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,6 ,0},
  360.                 {6 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,15,15,15,15,15,15,1 ,1 ,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,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,6 ,0},
  430.                 {6 ,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,6 ,0}
  431.                 };
  432.             }
  433.         }
  434.  
  435.         private static void MoveCursor()
  436.         {
  437.             Console.SetCursorPosition(x, y);
  438.  
  439.             if (Console.KeyAvailable)
  440.             {
  441.                 ConsoleKey k = Console.ReadKey(true).Key;
  442.  
  443.                 if (k == ConsoleKey.D || k == ConsoleKey.RightArrow)
  444.                 {
  445.                     x += 2;
  446.                     if (x > Console.WindowWidth - 3)
  447.                     {
  448.                         x = 2;
  449.                     }
  450.                 }
  451.                 if (k == ConsoleKey.A || k == ConsoleKey.LeftArrow)
  452.                 {
  453.                     x -= 2;
  454.                     if (x < 1)
  455.                     {
  456.                         x = Console.WindowWidth - 4;
  457.                     }
  458.                 }
  459.                 if (k == ConsoleKey.W || k == ConsoleKey.UpArrow)
  460.                 {
  461.                     y -= 1;
  462.                     if (y < 1)
  463.                     {
  464.                         y = Console.WindowHeight - 2;
  465.                     }
  466.                 }
  467.                 if (k == ConsoleKey.S || k == ConsoleKey.DownArrow)
  468.                 {
  469.                     y += 1;
  470.                     if (y > Console.WindowHeight - 2)
  471.                     {
  472.                         y = 1;
  473.                     }
  474.                 }
  475.                 if (k == ConsoleKey.Enter || k == ConsoleKey.Spacebar)
  476.                 {
  477.                     Bottoms();
  478.                 }
  479.             }
  480.         }
  481.  
  482.         private static void Time()
  483.         {
  484.             Console.BackgroundColor = ConsoleColor.Green;
  485.             Console.ForegroundColor = ConsoleColor.Black;
  486.             Console.SetCursorPosition(Console.WindowWidth - 28, Console.WindowHeight - 3);
  487.             Console.Write(DateTime.Now.ToString("dd MMMM yyyy | HH:mm:ss"));
  488.             Console.ResetColor();
  489.         }
  490.  
  491.         private static void Bottoms()
  492.         {
  493.             if (x <= 10 && y >= Console.WindowHeight - 4 && !StartOpen && !pauseOpen)
  494.             {
  495.                 StartOpen = true;
  496.                 StartDraw();
  497.             }
  498.             else if (x <= 10 && y >= Console.WindowHeight - 4 && StartOpen)
  499.             {
  500.                 StartOpen = false;
  501.                 OperatingSystem();
  502.             }
  503.             else if (x <= 26 && (y > Console.WindowHeight - 27) && (y < Console.WindowHeight - 23) && StartOpen)
  504.             {
  505.                 FolderOpen = true;
  506.                 DrawingOpen = false;
  507.                 StartOpen = false;
  508.                 PingPongOpen = false;
  509.                 OperatingSystem();
  510.             }
  511.             else if (x <= 26 && (y > Console.WindowHeight - 23) && (y < Console.WindowHeight - 19) && StartOpen)
  512.             {
  513.                 DrawingOpen = true;
  514.                 Drawing = true;
  515.                 PingPongOpen = false;
  516.                 StartOpen = false;
  517.                 OperatingSystem();
  518.             }
  519.             else if (x <= 26 && (y > Console.WindowHeight - 15) && (y < Console.WindowHeight - 11) && StartOpen)
  520.             {
  521.                 PlatformerOpen = true;
  522.                 DrawingOpen = false;
  523.                 Drawing = true;
  524.                 PingPongOpen = false;
  525.                 StartOpen = false;
  526.                 OperatingSystem();
  527.             }
  528.             else if (x == 6 && y >= 7 && y <= 22 && DrawingOpen)
  529.             {
  530.                 for (int i = 7; i <= 22; i++)
  531.                 {
  532.                     if (y == i)
  533.                     {
  534.                         color = i - 6;
  535.                     }
  536.                 }
  537.             }
  538.             else if (x >= 64 && x <= 72 && y == 6 && SaveOrLoadOpen)
  539.             {
  540.                 Drawing = true;
  541.                 SaveOrLoadOpen = false;
  542.                 OperatingSystem();
  543.             }
  544.             else if (x >= 64 && x <= 76 && (y == 8 || y == 10 || y == 12) && SaveOrLoadOpen)
  545.             {
  546.                 if (SaveDrawing)
  547.                 {
  548.                     if (y == 8)
  549.                     {
  550.                         Image1Save = true;
  551.                         Array.Copy(DrawingSaveMain, DrawingSave1 = new int[18, 52], DrawingSaveMain.Length);
  552.                     }
  553.                     if (y == 10)
  554.                     {
  555.                         Image2Save = true;
  556.                         Array.Copy(DrawingSaveMain, DrawingSave2 = new int[18, 52], DrawingSaveMain.Length);
  557.                     }
  558.                     if (y == 12)
  559.                     {
  560.                         Image3Save = true;
  561.                         Array.Copy(DrawingSaveMain, DrawingSave3 = new int[18, 52], DrawingSaveMain.Length);
  562.                     }
  563.                 }
  564.                 else
  565.                 {
  566.                     if (y == 8)
  567.                         if (Image1Save)
  568.                             Array.Copy(DrawingSave1, DrawingSaveMain = new int[18, 52], DrawingSave1.Length);
  569.                     if (y == 10)
  570.                         if (Image2Save)
  571.                             Array.Copy(DrawingSave2, DrawingSaveMain = new int[18, 52], DrawingSave1.Length);
  572.                     if (y == 12)
  573.                         if (Image3Save)
  574.                             Array.Copy(DrawingSave3, DrawingSaveMain = new int[18, 52], DrawingSave1.Length);
  575.                 }
  576.                 Drawing = true;
  577.                 SaveOrLoadOpen = false;
  578.                 OperatingSystem();
  579.             }
  580.             else if (x >= 12 && x <= 30 && y == 4 && DrawingOpen && Drawing)
  581.             {
  582.                 ResetDrawingSaveMain();
  583.                 OperatingSystem();
  584.             }
  585.             else if (x >= 12 && x <= 112 && y >= 6 && y <= 23 && DrawingOpen && Drawing)
  586.             {
  587.                 DrawingSaveMain[y - 6, (x - 12) / 2] = color;
  588.                 ChooseColor(color);
  589.                 Console.Write("  ");
  590.             }
  591.             else if (x >= 40 && x <= 80 && y == 4 && DrawingOpen)
  592.             {
  593.                 SaveOrLoadOpen = true;
  594.                 if (x >= 40 && x <= 53)
  595.                 {
  596.                     Drawing = false;
  597.                     SaveDrawing = true;
  598.                     SaveOrLoadDrawingDraw();
  599.                 }
  600.                 else if (x >= 66 && x <= 78)
  601.                 {
  602.                     Drawing = false;
  603.                     SaveDrawing = false;
  604.                     SaveOrLoadDrawingDraw();
  605.                 }
  606.             }
  607.             else if (x <= 26 && (y > Console.WindowHeight - 19) && (y < Console.WindowHeight - 15) && StartOpen)
  608.             {
  609.                 PingPongOpen = true;
  610.                 DrawingOpen = false;
  611.                 FolderOpen = false;
  612.                 StartOpen = false;
  613.                 OperatingSystem();
  614.             }
  615.             else if (x >= 50 && x <= 70 && y >= 9 && y <= 18 && PingPongOpen && !ExitOpen)
  616.             {
  617.                 botLvlHard = (y - 8) * 10;
  618.                 if (y == 9) ballSlow = 75;
  619.                 if (y == 10) ballSlow = 70;
  620.                 if (y == 11) ballSlow = 65;
  621.                 if (y == 12) ballSlow = 60;
  622.                 if (y == 13) ballSlow = 55;
  623.                 if (y == 14) ballSlow = 50;
  624.                 if (y == 15) ballSlow = 45;
  625.                 if (y == 16) ballSlow = 40;
  626.                 if (y == 17) ballSlow = 35;
  627.                 if (y == 18) ballSlow = 30;
  628.  
  629.                 string botName = botsName[y - 9];
  630.  
  631.                 Console.BackgroundColor = ConsoleColor.White;
  632.                 Console.ForegroundColor = ConsoleColor.Black;
  633.  
  634.                 Console.SetCursorPosition(66, 4);
  635.                 Console.Write(botName);
  636.  
  637.                 PingPong();
  638.             }
  639.             else if (x >= Console.WindowWidth - 18 && x <= Console.WindowWidth - 6 && y == Console.WindowHeight - 28 && PingPongOpen)
  640.             {
  641.                 PingPongOpen = false;
  642.                 OperatingSystem();
  643.             }
  644.             else if (x <= 26 && (y > Console.WindowHeight - 8) && (y < Console.WindowHeight - 4) && StartOpen)
  645.             {
  646.                 ExitOpen = true;
  647.                 StartOpen = false;
  648.                 OperatingSystem();
  649.             }
  650.             else if (x >= Console.WindowWidth - 18 && x <= Console.WindowWidth - 6 && y == Console.WindowHeight - 28 && FolderOpen)
  651.             {
  652.                 FolderOpen = false;
  653.                 OperatingSystem();
  654.             }
  655.             else if (x >= Console.WindowWidth - 18 && x <= Console.WindowWidth - 6 && y == 2 && DrawingOpen)
  656.             {
  657.                 SaveOrLoadOpen = false;
  658.                 DrawingOpen = false;
  659.                 OperatingSystem();
  660.             }
  661.             else if (x >= Console.WindowWidth - 18 && x <= Console.WindowWidth - 6 && y == 2 && PlatformerOpen)
  662.             {
  663.                 PlatformerOpen = false;
  664.                 pauseOpen = false;
  665.                 OperatingSystem();
  666.             }
  667.             else if (x >= Console.WindowWidth - 74 && x <= Console.WindowWidth - 66 && y >= 16 && y <= Console.WindowHeight - 12 && !ExitOpen && pauseOpen)
  668.             {
  669.                 pauseOpen = false;
  670.                 PlatformerOpen = false;
  671.                 OperatingSystem();
  672.             }
  673.             else if (x >= Console.WindowWidth - 56 && x <= Console.WindowWidth - 48 && y >= 16 && y <= Console.WindowHeight - 12 && !ExitOpen && pauseOpen)
  674.             {
  675.                 pauseOpen = false;
  676.                 PlatformerGameplay();
  677.             }
  678.             else if (x >= Console.WindowWidth - 74 && x <= Console.WindowWidth - 66 && y >= 16 && y <= Console.WindowHeight - 12 && ExitOpen)
  679.             {
  680.                 ExitOpen = false;
  681.                 OperatingSystem();
  682.             }
  683.             else if (x >= Console.WindowWidth - 56 && x <= Console.WindowWidth - 48 && y >= 16 && y <= Console.WindowHeight - 12 && ExitOpen)
  684.             {
  685.                 System.Environment.Exit(1);
  686.             }
  687.         }
  688.  
  689.         private static void UIDraw()
  690.         {
  691.             Console.BackgroundColor = ConsoleColor.Blue;
  692.             Box(Console.WindowWidth - 4, Console.WindowHeight - 5, 2, 1);
  693.  
  694.             Console.BackgroundColor = ConsoleColor.DarkCyan;
  695.             Box(Console.WindowWidth - 43, 3, 11, (Console.WindowHeight - 4));
  696.  
  697.             for (int i = 1; i <= 3; i++)
  698.             {
  699.                 Console.SetCursorPosition(12, Console.WindowHeight - i - 1);
  700.                 Console.Write("║");
  701.             }
  702.  
  703.             Console.BackgroundColor = ConsoleColor.Green;
  704.             Box(9, 3, 2, (Console.WindowHeight - 4));
  705.  
  706.             Box(30, 3, (Console.WindowWidth - 32), (Console.WindowHeight - 4));
  707.  
  708.             Console.ForegroundColor = ConsoleColor.Black;
  709.             Console.SetCursorPosition(4, Console.WindowHeight - 3);
  710.             Console.Write("Старт");
  711.  
  712.             if (!FolderOpen && !DrawingOpen && !ExitOpen && !PingPongOpen)
  713.             {
  714.                 ChooseImage(0);
  715.  
  716.                 DrawImage((Console.WindowWidth / 2 - 16), (Console.WindowHeight - 18) / 2);
  717.             }
  718.  
  719.             if (StartOpen)
  720.             {
  721.                 StartDraw();
  722.             }
  723.             if (FolderOpen)
  724.             {
  725.                 FolderDraw();
  726.             }
  727.             if (DrawingOpen)
  728.             {
  729.                 DrawingDraw();
  730.             }
  731.             if (PingPongOpen)
  732.             {
  733.                 PingPongDraw();
  734.             }
  735.             if (PlatformerOpen)
  736.             {
  737.                 Platformer();
  738.             }
  739.             if (ExitOpen)
  740.             {
  741.                 ExitDraw();
  742.             }
  743.             Console.BackgroundColor = ConsoleColor.Black;
  744.         }
  745.  
  746.         private static void StartDraw()
  747.         {
  748.             Console.BackgroundColor = ConsoleColor.Black;
  749.             Box(26, 1, 2, Console.WindowHeight - 23);
  750.  
  751.             Console.ForegroundColor = ConsoleColor.White;
  752.             Console.SetCursorPosition(2, Console.WindowHeight - 28);
  753.             Console.Write("USER PC           DOORS OS");
  754.  
  755.             Console.BackgroundColor = ConsoleColor.White;
  756.             Box(26, Console.WindowHeight - 10, 2, Console.WindowHeight - 27);
  757.  
  758.             Console.BackgroundColor = ConsoleColor.Red;
  759.             Box(26, 3, 2, Console.WindowHeight - 7);
  760.  
  761.             Console.ForegroundColor = ConsoleColor.Black;
  762.             Console.SetCursorPosition(6, Console.WindowHeight - 6);
  763.             Console.Write("Завершение работы");
  764.  
  765.             Console.BackgroundColor = ConsoleColor.Yellow;
  766.             Box(26, 3, 2, Console.WindowHeight - 26);
  767.  
  768.             Console.SetCursorPosition(6, Console.WindowHeight - 25);
  769.             Console.Write("Папка с файлами");
  770.  
  771.             Console.BackgroundColor = ConsoleColor.Cyan;
  772.             Box(26, 3, 2, Console.WindowHeight - 22);
  773.  
  774.             Console.SetCursorPosition(6, Console.WindowHeight - 21);
  775.             Console.Write("Рисовалка");
  776.  
  777.             Console.BackgroundColor = ConsoleColor.Green;
  778.             Box(26, 3, 2, 12);
  779.  
  780.             Console.SetCursorPosition(6, 13);
  781.             Console.Write("Пинг-Понг");
  782.  
  783.             Console.BackgroundColor = ConsoleColor.DarkGray;
  784.             Box(26, 3, 2, 16);
  785.  
  786.             Console.SetCursorPosition(6, 17);
  787.             Console.Write("Платформер");
  788.         }
  789.  
  790.         private static void ExitDraw()
  791.         {
  792.             Console.BackgroundColor = ConsoleColor.Black;
  793.             Box(32, 3, (Console.WindowWidth - 32) / 2, (Console.WindowHeight - 10) / 2);
  794.  
  795.             Console.ForegroundColor = ConsoleColor.White;
  796.             Console.SetCursorPosition((Console.WindowWidth - 20) / 2, (Console.WindowHeight - 8) / 2);
  797.             Console.Write("Выключить Doors OS?");
  798.  
  799.             Console.BackgroundColor = ConsoleColor.Cyan;
  800.             Box(32, 7, (Console.WindowWidth - 32) / 2, Console.WindowHeight - 17);
  801.  
  802.             Console.BackgroundColor = ConsoleColor.Red;
  803.             Box(10, 3, Console.WindowWidth - 74, Console.WindowHeight - 14);
  804.  
  805.             Console.ForegroundColor = ConsoleColor.Black;
  806.             Console.SetCursorPosition(Console.WindowWidth - 71, Console.WindowHeight - 13);
  807.             Console.Write("Нет");
  808.  
  809.             Console.BackgroundColor = ConsoleColor.Green;
  810.             Box(10, 3, Console.WindowWidth - 56, Console.WindowHeight - 14);
  811.  
  812.             Console.SetCursorPosition(Console.WindowWidth - 52, Console.WindowHeight - 13);
  813.             Console.Write("Да");
  814.         }
  815.  
  816.         private static void FolderDraw()
  817.         {
  818.             Console.BackgroundColor = ConsoleColor.Black;
  819.             Box(Console.WindowWidth - 8, 1, 4, Console.WindowHeight - 28);
  820.  
  821.             Console.ForegroundColor = ConsoleColor.White;
  822.             Console.SetCursorPosition(4, Console.WindowHeight - 28);
  823.             Console.Write("Папка с файлами");
  824.  
  825.             Console.BackgroundColor = ConsoleColor.Red;
  826.             Box(14, 1, Console.WindowWidth - 18, Console.WindowHeight - 28);
  827.  
  828.             Console.ForegroundColor = ConsoleColor.Black;
  829.             Console.SetCursorPosition(Console.WindowWidth - 16, Console.WindowHeight - 28);
  830.             Console.Write("Закрыть[X]");
  831.  
  832.             Console.BackgroundColor = ConsoleColor.White;
  833.             Box(Console.WindowWidth - 8, Console.WindowHeight - 8, 4, Console.WindowHeight - 27);
  834.  
  835.             Console.ForegroundColor = ConsoleColor.Black;
  836.             Console.SetCursorPosition(8, Console.WindowHeight - 26);
  837.             Console.Write("Файлов и функционала пока нет, но Вы там держитесь!");
  838.         }
  839.  
  840.         private static void DrawingDraw()
  841.         {
  842.             Console.BackgroundColor = ConsoleColor.Black;
  843.             Console.ForegroundColor = ConsoleColor.Gray;
  844.             Console.SetCursorPosition(4, 2);
  845.             Console.Write("Рисовалка".PadRight(98));
  846.  
  847.             Console.BackgroundColor = ConsoleColor.Red;
  848.             Console.ForegroundColor = ConsoleColor.Black;
  849.             Console.SetCursorPosition(102, 2);
  850.             Console.Write("  Закрыть[X]  ");
  851.  
  852.             Console.BackgroundColor = ConsoleColor.Gray;
  853.             Box(112, 22, 4, 3);
  854.  
  855.             Console.SetCursorPosition(5, 4);
  856.             Console.Write("Цвет:");
  857.  
  858.             Console.SetCursorPosition(5, 6);
  859.             Console.Write("╔══╗");
  860.  
  861.             for (int i = 1; i <= 16; i++)
  862.             {
  863.                 Console.SetCursorPosition(5, 6 + i);
  864.                 Console.Write("║  ║");
  865.             }
  866.  
  867.             Console.SetCursorPosition(5, 23);
  868.             Console.Write("╚══╝");
  869.  
  870.             Console.BackgroundColor = ConsoleColor.Black;
  871.             Console.ForegroundColor = ConsoleColor.White;
  872.  
  873.             Console.SetCursorPosition(12, 4);
  874.             Console.Write("  Очистить полотно  ");
  875.  
  876.             Console.SetCursorPosition(40, 4);
  877.             Console.Write("  Сохранить   ");
  878.  
  879.             Console.SetCursorPosition(66, 4);
  880.             Console.Write("  Загрузить   ");
  881.  
  882.             ChooseImage(5);
  883.             DrawImage(6, 7);
  884.  
  885.             ChooseImage(6);
  886.             DrawImage(12, 6);
  887.  
  888.             if (SaveOrLoadOpen)
  889.             {
  890.                 SaveOrLoadDrawingDraw();
  891.             }
  892.         }
  893.  
  894.         private static void SaveOrLoadDrawingDraw()
  895.         {
  896.             Console.BackgroundColor = ConsoleColor.DarkCyan;
  897.             Box(40, 9, 40, 5);
  898.             string chooseText;
  899.  
  900.             string chooseCell;
  901.             string SaveOrLoad;
  902.  
  903.             if (SaveDrawing)
  904.             {
  905.                 chooseText = "ячейки  ";
  906.                 chooseCell = "ячейка  ";
  907.                 SaveOrLoad = "  Сохранить   ";
  908.             }
  909.             else
  910.             {
  911.                 chooseText = "картинки  ";
  912.                 chooseCell = "картинка  ";
  913.                 SaveOrLoad = "  Загрузить   ";
  914.             }
  915.  
  916.             Console.ForegroundColor = ConsoleColor.White;
  917.             Console.SetCursorPosition(42, 6);
  918.             Console.Write("Выбор {0}", chooseText);
  919.  
  920.             Console.BackgroundColor = ConsoleColor.White;
  921.             Console.ForegroundColor = ConsoleColor.Black;
  922.  
  923.             for (int i = 1; i <= 3; i++)
  924.             {
  925.                 Console.SetCursorPosition(42, 6 + i * 2);
  926.                 Console.Write("{0} {1}", i, chooseCell);
  927.  
  928.                 Console.SetCursorPosition(64, 6 + i * 2);
  929.                 Console.Write(SaveOrLoad);
  930.             }
  931.             Console.SetCursorPosition(64, 6);
  932.             Console.Write("  Отмена  ");
  933.         }
  934.  
  935.         private static void UpdateDraw()
  936.         {
  937.             Console.CursorVisible = false;
  938.  
  939.             Console.BackgroundColor = ConsoleColor.Blue;
  940.             Box(Console.WindowWidth - 4, Console.WindowHeight - 2, 2, 1);
  941.  
  942.             Console.ForegroundColor = ConsoleColor.White;
  943.             string UpdateDoorsOS = "Обновление Doors OS";
  944.             string EverythingIsFine = "Все нормально. Это может занять некоторое время.";
  945.  
  946.             Console.SetCursorPosition((Console.WindowWidth - UpdateDoorsOS.Length) / 2, (Console.WindowHeight / 2) - 10);
  947.             Console.WriteLine(UpdateDoorsOS);
  948.  
  949.             Console.SetCursorPosition((Console.WindowWidth - EverythingIsFine.Length) / 2, (Console.WindowHeight / 2) - 8);
  950.             Console.WriteLine(EverythingIsFine);
  951.  
  952.             int ProgressPersents = 0;
  953.  
  954.             while (ProgressPersents < 100)
  955.             {
  956.                 Random r = new Random();
  957.                 int ProgressPlus = r.Next(0, 6);
  958.  
  959.                 if (ProgressPersents > 95)
  960.                 {
  961.                     ProgressPlus = 100 - ProgressPersents;
  962.                 }
  963.  
  964.                 ProgressPersents += ProgressPlus;
  965.  
  966.                 string Progress = "Выполнено: " + ProgressPersents + " % ";
  967.  
  968.                 Console.SetCursorPosition((Console.WindowWidth - Progress.Length) / 2, (Console.WindowHeight / 2) - 4);
  969.                 Console.WriteLine(Progress);
  970.  
  971.                 Thread.Sleep(400);
  972.                 Console.CursorVisible = true;
  973.             }
  974.         }
  975.  
  976.         private static void Update()
  977.         {
  978.             if ((timeStart + 2) <= TimeCheck() && ToUpDate)
  979.             {
  980.                 Kitty = true;
  981.                 ToUpDate = false;
  982.                 UpdateDraw();
  983.                 Main();
  984.             }
  985.         }
  986.  
  987.         private static void OperatingSystem()
  988.         {
  989.             UIDraw();
  990.             //AnimalsAndHunters();
  991.             while (true)
  992.             {
  993.                 Time();
  994.                 MoveCursor();
  995.                 Update();
  996.             }
  997.         }
  998.  
  999.         //--------------------------------------
  1000.  
  1001.         private static void PingPongDraw()
  1002.         {
  1003.             Console.BackgroundColor = ConsoleColor.Black;
  1004.             Console.ForegroundColor = ConsoleColor.Gray;
  1005.             Console.SetCursorPosition(4, 2);
  1006.             Console.Write("Пинг-Понг".PadRight(98));
  1007.  
  1008.             Console.BackgroundColor = ConsoleColor.Red;
  1009.             Console.ForegroundColor = ConsoleColor.Black;
  1010.             Console.SetCursorPosition(102, 2);
  1011.             Console.Write("  Закрыть[X]  ");
  1012.  
  1013.             Console.BackgroundColor = ConsoleColor.White;
  1014.             Box(112, 22, 4, 3);
  1015.  
  1016.             Console.BackgroundColor = ConsoleColor.Black;
  1017.             Box(4, 2, 6, 4);
  1018.             Box(4, 2, 6, 22);
  1019.             Box(4, 2, 110, 4);
  1020.             Box(4, 2, 110, 22);
  1021.  
  1022.             Console.BackgroundColor = ConsoleColor.Green;
  1023.             Box(104, 18, 8, 5);
  1024.  
  1025.             ChooseBot();
  1026.         }
  1027.  
  1028.         private static void PingPong()
  1029.         {
  1030.             PingPongSettings();
  1031.  
  1032.             Console.CursorVisible = false;
  1033.  
  1034.             while (true)
  1035.             {
  1036.                 Time();
  1037.                 PlayerMove();
  1038.  
  1039.                 BotMove();
  1040.                 MoveBall();
  1041.                 Console.BackgroundColor = ConsoleColor.Green;
  1042.                 Console.ForegroundColor = ConsoleColor.Black;
  1043.                 Box(104, 18, 8, 5);
  1044.                 DrawPlayer();
  1045.                 DrawBot();
  1046.  
  1047.                 Console.SetCursorPosition(ballPosX, ballPosY);
  1048.                 Console.Write("  ");
  1049.  
  1050.                 PrintResult();
  1051.                 Thread.Sleep(ballSlow);
  1052.             }
  1053.         }
  1054.  
  1055.         private static void ChooseBot()
  1056.         {
  1057.             botsName = new List<string>()
  1058.             {"Неудачник", "Новичок", "Середнячок", "Опытный", "Тот чел с района",
  1059.              "Городская легенда", "Чемпион Гондураса", "Жека Чан", "Мастер унижения", "Борис Лихач"};
  1060.  
  1061.             Console.BackgroundColor = ConsoleColor.Black;
  1062.             Console.ForegroundColor = ConsoleColor.White;
  1063.  
  1064.             Console.SetCursorPosition(50, 6);
  1065.             Console.Write("Выберите противника:  ");
  1066.  
  1067.             int i = 0;
  1068.             foreach (string s in botsName)
  1069.             {
  1070.                 Console.SetCursorPosition(50, 9 + i);
  1071.                 Console.Write("{0}. {1}".PadRight(27 - s.Length), i, s);
  1072.                 i++;
  1073.             }
  1074.         }
  1075.  
  1076.         private static void PingPongSettings()
  1077.         {
  1078.             ResetBall();
  1079.  
  1080.             playerPos = Console.WindowHeight / 2 - playerpadSize / 2;
  1081.             botPos = Console.WindowHeight / 2 - botpadSize / 2;
  1082.  
  1083.             playerpadSize = 5;
  1084.             botpadSize = 5;
  1085.  
  1086.             playerResult = 0;
  1087.             botResult = 0;
  1088.  
  1089.             ballDirectionUp = true;
  1090.             ballDirectionRight = true;
  1091.  
  1092.             Console.ForegroundColor = ConsoleColor.Black;
  1093.             Console.BackgroundColor = ConsoleColor.White;
  1094.  
  1095.             Console.SetCursorPosition(50, 4);
  1096.             Console.Write("Вы");
  1097.  
  1098.             Console.SetCursorPosition(30, 23);
  1099.             Console.Write("Нажмите Esc, чтобы закончить раунд и выбрать другого соперника");
  1100.         }
  1101.  
  1102.         private static void ResetBall()
  1103.         {
  1104.             ballPosX = Console.WindowWidth / 2;
  1105.             ballPosY = Console.WindowHeight / 2;
  1106.         }
  1107.  
  1108.         private static void DrawPlayer()
  1109.         {
  1110.             Console.BackgroundColor = ConsoleColor.Black;
  1111.  
  1112.             Box(2, playerpadSize, 8, playerPos);
  1113.         }
  1114.  
  1115.         private static void DrawBot()
  1116.         {
  1117.             Box(2, playerpadSize, 110, botPos);
  1118.         }
  1119.  
  1120.         private static void PrintResult()
  1121.         {
  1122.             Console.BackgroundColor = ConsoleColor.White;
  1123.             Console.SetCursorPosition(Console.WindowWidth / 2 - 3, 4);
  1124.             Console.WriteLine("{0} - {1}", playerResult, botResult);
  1125.             Console.ResetColor();
  1126.         }
  1127.  
  1128.         private static void MovePlayerUp()
  1129.         {
  1130.             if (playerPos > 5)
  1131.             {
  1132.                 playerPos--;
  1133.             }
  1134.         }
  1135.  
  1136.         private static void MovePlayerDown()
  1137.         {
  1138.             if (playerPos < 23 - playerpadSize)
  1139.             {
  1140.                 playerPos++;
  1141.             }
  1142.         }
  1143.  
  1144.         private static void MoveBotUp()
  1145.         {
  1146.             if (botPos > 5)
  1147.             {
  1148.                 botPos--;
  1149.             }
  1150.         }
  1151.  
  1152.         private static void MoveBotDown()
  1153.         {
  1154.             if (botPos < 23 - botpadSize)
  1155.             {
  1156.                 botPos++;
  1157.             }
  1158.         }
  1159.  
  1160.         private static void PlayerMove()
  1161.         {
  1162.             if (Console.KeyAvailable)
  1163.             {
  1164.                 Console.BackgroundColor = ConsoleColor.Green;
  1165.                 Console.ForegroundColor = ConsoleColor.Green;
  1166.  
  1167.                 ConsoleKeyInfo keyInfo = Console.ReadKey();
  1168.  
  1169.                 if (keyInfo.Key == ConsoleKey.UpArrow || keyInfo.Key == ConsoleKey.W)
  1170.                 {
  1171.                     MovePlayerUp();
  1172.                 }
  1173.  
  1174.                 if (keyInfo.Key == ConsoleKey.DownArrow || keyInfo.Key == ConsoleKey.S)
  1175.                 {
  1176.                     MovePlayerDown();
  1177.                 }
  1178.                 if (keyInfo.Key == ConsoleKey.Escape)
  1179.                 {
  1180.                     Console.CursorVisible = true;
  1181.                     OperatingSystem();
  1182.                 }
  1183.             }
  1184.         }
  1185.  
  1186.         private static void BotMove()
  1187.         {
  1188.             int randomNumber = randomGenerator.Next(1, 100);
  1189.  
  1190.             if (randomNumber < botLvlHard)
  1191.             {
  1192.  
  1193.                 if (ballDirectionUp == true)
  1194.                 {
  1195.                     MoveBotUp();
  1196.                 }
  1197.                 else
  1198.                 {
  1199.                     MoveBotDown();
  1200.                 }
  1201.             }
  1202.         }
  1203.  
  1204.         private static void MoveBall()
  1205.         {
  1206.             if (ballPosY == 5)
  1207.             {
  1208.                 ballDirectionUp = false;
  1209.             }
  1210.  
  1211.             if (ballPosY == 22)
  1212.             {
  1213.                 ballDirectionUp = true;
  1214.             }
  1215.  
  1216.             if (ballPosX == 110)
  1217.             {
  1218.                 ResetBall();
  1219.                 ballDirectionUp = false;
  1220.                 ballDirectionRight = false;
  1221.                 playerResult++;
  1222.             }
  1223.  
  1224.             if (ballPosX == 8)
  1225.             {
  1226.                 ResetBall();
  1227.                 ballDirectionUp = true;
  1228.                 ballDirectionRight = true;
  1229.                 botResult++;
  1230.             }
  1231.  
  1232.             if (ballPosX < 11)
  1233.             {
  1234.                 if (ballPosY >= playerPos && ballPosY < playerPos + playerpadSize)
  1235.                 {
  1236.                     ballDirectionRight = true;
  1237.                 }
  1238.             }
  1239.  
  1240.             if (ballPosX >= 108)
  1241.             {
  1242.                 if (ballPosY >= botPos && ballPosY < botPos + botpadSize)
  1243.                 {
  1244.                     ballDirectionRight = false;
  1245.                 }
  1246.             }
  1247.  
  1248.             if (ballDirectionUp)
  1249.             {
  1250.                 ballPosY--;
  1251.             }
  1252.             else
  1253.             {
  1254.                 ballPosY++;
  1255.             }
  1256.  
  1257.             if (ballDirectionRight)
  1258.             {
  1259.                 ballPosX++;
  1260.             }
  1261.             else
  1262.             {
  1263.                 ballPosX--;
  1264.             }
  1265.         }
  1266.  
  1267.         #endregion
  1268.  
  1269.         //--------------------------------------------
  1270.         //-----------------Платформер-----------------
  1271.         //--------------------------------------------
  1272.  
  1273.         private static void Platformer()
  1274.         {
  1275.             PlatformerSettings();
  1276.             PlatformerTutorial();
  1277.             PlatformerGameplay();
  1278.         }
  1279.  
  1280.         private static void PlatformerSettings()
  1281.         {
  1282.             xPosPlayer = 10;
  1283.             yPosPlayer = 10;
  1284.             playerHealth = 100;
  1285.             PlatformerDraw();
  1286.             ChooseImage(7);
  1287.             pauseOpen = false;
  1288.             playerDirectionRight = true;
  1289.             playerJump = false;
  1290.             isGrounded = false;
  1291.             canJump = false;
  1292.             otherGravity = false;
  1293.             nextLvlNumber = 2;
  1294.         }
  1295.  
  1296.         private static void PlatformerGameplay()
  1297.         {
  1298.             while (true)
  1299.             {
  1300.                 Time();
  1301.                 HealthOutput();
  1302.                 GroundTest();
  1303.                 MovePlayer();
  1304.                 DrawImage(6, 4);
  1305.                 PlayerDraw();
  1306.                 Gravitation();
  1307.                 Thread.Sleep(50);
  1308.             }
  1309.         }
  1310.  
  1311.         private static void PlatformerTutorial()
  1312.         {
  1313.             Console.SetCursorPosition(54, 5);
  1314.             Console.ForegroundColor = ConsoleColor.White;
  1315.             Console.Write("Обучение");
  1316.  
  1317.             Console.SetCursorPosition(10, 7);
  1318.             Console.Write("Управление персонажем - W-A-S-D, Esc - пауза.");
  1319.  
  1320.             Console.SetCursorPosition(10, 9);
  1321.             Console.Write("Серые участки карты - это стены, голубые - лестницы, красные - раскаленный пол(наносит урон),");
  1322.  
  1323.             Console.SetCursorPosition(10, 10);
  1324.             Console.Write("зеленые - выход в другой уровень.");
  1325.  
  1326.             Console.SetCursorPosition(10, 12);
  1327.             Console.Write("Если стать на белый участок карты и нажать пробел, поменяется гравитация.");
  1328.  
  1329.             Console.SetCursorPosition(10, 20);
  1330.             Console.Write("Удачи. Нажми любую кнопку чтобы продолжить...");
  1331.  
  1332.             Time();
  1333.             Console.SetCursorPosition(10, 21);
  1334.  
  1335.             Console.ReadKey();
  1336.         }
  1337.  
  1338.         private static void NextLevel()
  1339.         {
  1340.             int[,] playerPos = new int[,] { { 16, 5 }, { 50, 5 } };
  1341.             if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] == 12 || image[yPosPlayer - 3, (xPosPlayer - 6) / 2] == 12 || image[yPosPlayer - 4, (xPosPlayer - 6) / 2] == 12)
  1342.             {
  1343.                 xPosPlayer = playerPos[nextLvlNumber - 2, 0];
  1344.                 yPosPlayer = playerPos[nextLvlNumber - 2, 1];
  1345.                 ChooseImage(nextLvlNumber + 6);
  1346.                 otherGravity = false;
  1347.                 nextLvlNumber++;
  1348.                 playerHealth = 100;
  1349.             }
  1350.         }
  1351.  
  1352.         private static void MovePlayer()
  1353.         {
  1354.             if (Console.KeyAvailable)
  1355.             {
  1356.                 Console.SetCursorPosition(xPosPlayer, yPosPlayer);
  1357.  
  1358.                 ConsoleKey k = Console.ReadKey(true).Key;
  1359.  
  1360.                 if (k == ConsoleKey.D || k == ConsoleKey.RightArrow)
  1361.                 {
  1362.                     xPosPlayer += 2;
  1363.                     playerDirectionRight = true;
  1364.                     NextLevel();
  1365.                     if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] == 3 && image[yPosPlayer - 3, (xPosPlayer - 6) / 2] == 3 && image[yPosPlayer - 4, (xPosPlayer - 6) / 2] == 3)
  1366.                     {
  1367.  
  1368.                     }
  1369.                     else if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] == 14 || image[yPosPlayer - 3, (xPosPlayer - 6) / 2] == 14 || image[yPosPlayer - 4, (xPosPlayer - 6) / 2] == 14)
  1370.                     {
  1371.                         playerHealth -= 5;
  1372.                         xPosPlayer -= 2;
  1373.                     }
  1374.                     else if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] != 1 || image[yPosPlayer - 3, (xPosPlayer - 6) / 2] != 1 || image[yPosPlayer - 4, (xPosPlayer - 6) / 2] != 1)
  1375.                     {
  1376.                         xPosPlayer -= 2;
  1377.                     }
  1378.                 }
  1379.                 if (k == ConsoleKey.A || k == ConsoleKey.LeftArrow)
  1380.                 {
  1381.                     xPosPlayer -= 2;
  1382.                     playerDirectionRight = false;
  1383.                     NextLevel();
  1384.                     if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] == 3 && image[yPosPlayer - 3, (xPosPlayer - 6) / 2] == 3 && image[yPosPlayer - 4, (xPosPlayer - 6) / 2] == 3)
  1385.                     {
  1386.  
  1387.                     }
  1388.                     else if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] == 14 || image[yPosPlayer - 3, (xPosPlayer - 6) / 2] == 14 || image[yPosPlayer - 4, (xPosPlayer - 6) / 2] == 14)
  1389.                     {
  1390.                         playerHealth -= 5;
  1391.                         xPosPlayer -= 2;
  1392.                     }
  1393.                     else if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] != 1 || image[yPosPlayer - 3, (xPosPlayer - 6) / 2] != 1 || image[yPosPlayer - 4, (xPosPlayer - 6) / 2] != 1)
  1394.                     {
  1395.                         xPosPlayer += 2;
  1396.                     }
  1397.                 }
  1398.                 if ((k == ConsoleKey.W || k == ConsoleKey.UpArrow))
  1399.                 {
  1400.                     if ((image[yPosPlayer - 2, (xPosPlayer - 6) / 2] == 3 || image[yPosPlayer - 5, (xPosPlayer - 6) / 2] == 3) && image[yPosPlayer - 5, (xPosPlayer - 6) / 2] != 6)
  1401.                     {
  1402.                         yPosPlayer -= 1;
  1403.  
  1404.                     }
  1405.                     else if (!otherGravity && canJump && isGrounded)
  1406.                     {
  1407.                         jumpHeight = 3;
  1408.                         playerJump = true;
  1409.                     }
  1410.                 }
  1411.                 if (k == ConsoleKey.S || k == ConsoleKey.DownArrow)
  1412.                 {
  1413.                     if (image[yPosPlayer - 1, (xPosPlayer - 6) / 2] == 3)
  1414.                     {
  1415.                         yPosPlayer += 1;
  1416.                     }
  1417.                     else if (otherGravity && canJump && isGrounded)
  1418.                     {
  1419.                         jumpHeight = 3;
  1420.                         playerJump = true;
  1421.                     }
  1422.                 }
  1423.                 if (k == ConsoleKey.Spacebar)
  1424.                 {
  1425.                     if (!otherGravity)
  1426.                     {
  1427.                         if (image[yPosPlayer - 1, (xPosPlayer - 6) / 2] == 15)
  1428.                         {
  1429.                             otherGravity = true;
  1430.                         }
  1431.                     }
  1432.                     else
  1433.                     {
  1434.                         if (image[yPosPlayer - 5, (xPosPlayer - 6) / 2] == 15)
  1435.                         {
  1436.                             otherGravity = false;
  1437.                         }
  1438.                     }
  1439.                 }
  1440.                 if (k == ConsoleKey.Escape)
  1441.                 {
  1442.                     Console.CursorVisible = true;
  1443.                     pauseOpen = true;
  1444.                     PauseMenu();
  1445.                 }
  1446.             }
  1447.         }
  1448.  
  1449.         private static void HealthOutput()
  1450.         {
  1451.             Console.BackgroundColor = ConsoleColor.White;
  1452.             Console.ForegroundColor = ConsoleColor.Black;
  1453.             Console.SetCursorPosition(6, 24);
  1454.             Console.Write("Здоровье: {0}   ", playerHealth);
  1455.  
  1456.             if (playerHealth <= 0)
  1457.             {
  1458.                 OperatingSystem();
  1459.             }
  1460.         }
  1461.  
  1462.         private static void PauseMenu()
  1463.         {
  1464.             Console.BackgroundColor = ConsoleColor.Black;
  1465.             Box(32, 3, (Console.WindowWidth - 32) / 2, (Console.WindowHeight - 10) / 2);
  1466.  
  1467.             Console.ForegroundColor = ConsoleColor.White;
  1468.             Console.SetCursorPosition((Console.WindowWidth - 24) / 2, (Console.WindowHeight - 8) / 2);
  1469.             Console.Write("Пауза. Продолжить игру?");
  1470.  
  1471.             Console.BackgroundColor = ConsoleColor.Cyan;
  1472.             Box(32, 7, (Console.WindowWidth - 32) / 2, Console.WindowHeight - 17);
  1473.  
  1474.             Console.BackgroundColor = ConsoleColor.Red;
  1475.             Box(10, 3, Console.WindowWidth - 74, Console.WindowHeight - 14);
  1476.  
  1477.             Console.ForegroundColor = ConsoleColor.Black;
  1478.             Console.SetCursorPosition(Console.WindowWidth - 71, Console.WindowHeight - 13);
  1479.             Console.Write("Нет");
  1480.  
  1481.             Console.BackgroundColor = ConsoleColor.Green;
  1482.             Box(10, 3, Console.WindowWidth - 56, Console.WindowHeight - 14);
  1483.  
  1484.             Console.SetCursorPosition(Console.WindowWidth - 52, Console.WindowHeight - 13);
  1485.             Console.Write("Да");
  1486.  
  1487.             while (true)
  1488.             {
  1489.                 Time();
  1490.                 MoveCursor();
  1491.             }
  1492.         }
  1493.  
  1494.         private static void GroundTest()
  1495.         {
  1496.             if (!otherGravity)
  1497.             {
  1498.                 if (image[yPosPlayer - 1, (xPosPlayer - 6) / 2] == 1)
  1499.                 {
  1500.                     isGrounded = false;
  1501.                 }
  1502.                 else
  1503.                 {
  1504.                     isGrounded = true;
  1505.                     if (image[yPosPlayer - 1, (xPosPlayer - 6) / 2] == 14)
  1506.                     {
  1507.                         playerHealth -= 5;
  1508.                     }
  1509.                 }
  1510.             }
  1511.             else
  1512.             {
  1513.                 if (image[yPosPlayer - 5, (xPosPlayer - 6) / 2] == 1)
  1514.                 {
  1515.                     isGrounded = false;
  1516.                 }
  1517.                 else
  1518.                 {
  1519.                     isGrounded = true;
  1520.                     if (image[yPosPlayer - 5, (xPosPlayer - 6) / 2] == 14)
  1521.                     {
  1522.                         playerHealth -= 5;
  1523.                     }
  1524.                 }
  1525.             }
  1526.         }
  1527.  
  1528.         private static void Gravitation()
  1529.         {
  1530.             if (playerJump)
  1531.             {
  1532.                 if (!otherGravity)
  1533.                 {
  1534.                     if (image[yPosPlayer - 5, (xPosPlayer - 6) / 2] == 1)
  1535.                     {
  1536.                         yPosPlayer--;
  1537.                     }
  1538.                     else
  1539.                     {
  1540.                         if (image[yPosPlayer - 5, (xPosPlayer - 6) / 2] == 14)
  1541.                         {
  1542.                             playerHealth -= 10;
  1543.                         }
  1544.                         playerJump = false;
  1545.                     }
  1546.                 }
  1547.                 else
  1548.                 {
  1549.                     if (image[yPosPlayer - 1, (xPosPlayer - 6) / 2] == 1)
  1550.                     {
  1551.                         yPosPlayer++;
  1552.                     }
  1553.                     else
  1554.                     {
  1555.                         if (image[yPosPlayer - 1, (xPosPlayer - 6) / 2] == 14)
  1556.                         {
  1557.                             playerHealth -= 10;
  1558.                         }
  1559.                         playerJump = false;
  1560.                     }
  1561.                 }
  1562.                 if (jumpHeight == 0)
  1563.                 {
  1564.                     playerJump = false;
  1565.                 }
  1566.                 jumpHeight--;
  1567.             }
  1568.             else if (isGrounded)
  1569.             {
  1570.                 canJump = true;
  1571.             }
  1572.             else
  1573.             {
  1574.                 if (!otherGravity)
  1575.                 {
  1576.                     yPosPlayer++;
  1577.                 }
  1578.                 else
  1579.                 {
  1580.                     yPosPlayer--;
  1581.                 }
  1582.             }
  1583.             NextLevel();
  1584.         }
  1585.  
  1586.         private static void PlatformerDraw()
  1587.         {
  1588.             Console.BackgroundColor = ConsoleColor.Black;
  1589.             Console.ForegroundColor = ConsoleColor.Gray;
  1590.             Console.SetCursorPosition(4, 2);
  1591.             Console.Write("Платформер".PadRight(98));
  1592.  
  1593.             Console.BackgroundColor = ConsoleColor.Red;
  1594.             Console.ForegroundColor = ConsoleColor.Black;
  1595.             Console.SetCursorPosition(102, 2);
  1596.             Console.Write("  Закрыть[X]  ");
  1597.  
  1598.             Console.BackgroundColor = ConsoleColor.White;
  1599.             Box(112, 22, 4, 3);
  1600.  
  1601.             Console.BackgroundColor = ConsoleColor.Black;
  1602.             Box(108, 20, 6, 4);
  1603.         }
  1604.  
  1605.         private static void PlayerDraw()
  1606.         {
  1607.             Console.CursorVisible = false;
  1608.             Console.SetCursorPosition(xPosPlayer, yPosPlayer);
  1609.             Console.ResetColor();
  1610.             if (!otherGravity)
  1611.             {
  1612.                 if (playerDirectionRight)
  1613.                 {
  1614.                     Console.Write(">>");
  1615.                 }
  1616.                 else
  1617.                 {
  1618.                     Console.Write("<<");
  1619.                 }
  1620.                 Console.SetCursorPosition(xPosPlayer, yPosPlayer + 2);
  1621.                 Console.Write("/\\");
  1622.             }
  1623.             else
  1624.             {
  1625.                 Console.Write("\\/");
  1626.                 Console.SetCursorPosition(xPosPlayer, yPosPlayer + 2);
  1627.                 if (playerDirectionRight)
  1628.                 {
  1629.                     Console.Write(">>");
  1630.                 }
  1631.                 else
  1632.                 {
  1633.                     Console.Write("<<");
  1634.                 }
  1635.             }
  1636.             Console.SetCursorPosition(xPosPlayer, yPosPlayer + 1);
  1637.             Console.Write("██");
  1638.         }
  1639.     }
  1640. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement