Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Threading;
- namespace ConsoleApplication65
- {
- class Program
- {
- private static int x, y, timeStart, xBox, yBox, xPBox, yPBox, color,
- ballPosX, ballPosY, playerPos, botPos, playerpadSize,
- botpadSize, playerResult, botResult, botLvlHard, ballSlow,
- xPosPlayer, yPosPlayer, jumpHeight, playerHealth, nextLvlNumber;
- private static bool StartOpen, FolderOpen, DrawingOpen, Drawing, SaveOrLoadOpen, ExitOpen, SaveDrawing, PingPongOpen, PlatformerOpen,
- ballDirectionUp, ballDirectionRight, playerDirectionRight, canJump, playerJump, isGrounded, otherGravity, pauseOpen,
- Image1Save = false, Image2Save = false, Image3Save = false, Kitty = false, ToUpDate = true;
- private static int[,] image, AnimationSettins1, AnimationSettins2;
- private static int[,] DrawingSaveMain = new int[18, 52];
- private static int[,] DrawingSave1, DrawingSave2, DrawingSave3 = new int[18, 52];
- private static List<string> botsName;
- static Random randomGenerator = new Random();
- #region Основа
- private static void Main()
- {
- Settings();
- LoadingDraw();
- OperatingSystem();
- }
- private static void Settings()
- {
- timeStart = TimeCheck();
- if (timeStart > 58)
- {
- timeStart = -1;
- }
- StartOpen = false;
- FolderOpen = false;
- DrawingOpen = false;
- PingPongOpen = false;
- ExitOpen = false;
- color = 1;
- Console.SetWindowSize(120, 30);
- Console.BufferHeight = Console.WindowHeight;
- Console.BufferWidth = Console.WindowWidth;
- Console.Title = "Doors OS";
- x = 2;
- y = Console.WindowHeight - 5;
- ResetDrawingSaveMain();
- }
- private static void ResetDrawingSaveMain()
- {
- for (int i = 0; i <= 17; i++)
- {
- for (int j = 0; j <= 50; j++)
- {
- DrawingSaveMain[i, j] = 15;
- }
- DrawingSaveMain[i, 51] = 0;
- }
- }
- private static int TimeCheck()
- {
- int timeReturn;
- string curTimeShort = DateTime.Now.ToString("mm");
- timeReturn = Convert.ToInt32(curTimeShort);
- return timeReturn;
- }
- private static void LoadingAnimationSettings()
- {
- AnimationSettins1 = new int[,]
- {
- {1,1,10,5,45,7,0},
- {0,2,10,5,65,7,0},
- {0,3,10,5,45,17,0},
- {0,4,10,5,65,17,200},
- {1,1,10,5,47,8,0},
- {0,2,10,5,63,8,0},
- {0,3,10,5,47,16,0},
- {0,4,10,5,63,16,300},
- {1,1,10,5,50,10,0},
- {0,2,10,5,60,10,0},
- {0,3,10,5,50,15,0},
- {0,4,10,5,60,15,300},
- {1,1,10,10,50,5,0},
- {0,2,10,10,60,5,0},
- {0,3,10,10,50,15,0},
- {0,4,10,10,60,15,300},
- {1,1,10,10,50,5,0},
- {0,2,10,10,60,5,0},
- {0,4,10,10,60,15,0},
- {0,3,15,15,50,10,200},
- {1,3,20,20,50,5,200},
- {0,5,2,1,65,15,0}
- };
- AnimationSettins2 = new int[,]
- {
- {1,34,13,100},
- {2,46,13,100},
- {2,56,13,100},
- {3,66,13,100},
- {4,76,13,100},
- {2,88,13,100},
- {4,98,13,2000}
- };
- }
- private static void LoadingDraw()
- {
- Console.CursorVisible = false;
- LoadingAnimationSettings();
- for (int p = 0; p <= 21; p++)
- {
- if (AnimationSettins1[p, 0] == 1)
- {
- Console.ResetColor();
- Console.Clear();
- }
- if (AnimationSettins1[p, 1] == 1)
- {
- Console.BackgroundColor = ConsoleColor.Red;
- }
- if (AnimationSettins1[p, 1] == 2)
- {
- Console.BackgroundColor = ConsoleColor.Green;
- }
- if (AnimationSettins1[p, 1] == 3)
- {
- Console.BackgroundColor = ConsoleColor.Blue;
- }
- if (AnimationSettins1[p, 1] == 4)
- {
- Console.BackgroundColor = ConsoleColor.Yellow;
- }
- if (AnimationSettins1[p, 1] == 5)
- {
- Console.BackgroundColor = ConsoleColor.Black;
- }
- xBox = AnimationSettins1[p, 2];
- yBox = AnimationSettins1[p, 3];
- xPBox = AnimationSettins1[p, 4];
- yPBox = AnimationSettins1[p, 5];
- Box(xBox, yBox, xPBox, yPBox);
- Thread.Sleep(AnimationSettins1[p, 6]);
- }
- for (int i = 1; i <= 40; i++)
- {
- Console.ResetColor();
- Console.Clear();
- Console.BackgroundColor = ConsoleColor.Blue;
- Box(20, 20, (Console.WindowWidth / 2) - 10 - i, (Console.WindowHeight / 2) - 10);
- Console.BackgroundColor = ConsoleColor.Black;
- Box(2, 1, (Console.WindowWidth / 2) + 5 - i, Console.WindowHeight / 2);
- Thread.Sleep(10);
- }
- for (int p = 0; p <= 6; p++)
- {
- ChooseImage(AnimationSettins2[p, 0]);
- DrawImage(AnimationSettins2[p, 1], AnimationSettins2[p, 2]);
- Thread.Sleep(AnimationSettins2[p, 3]);
- }
- Console.CursorVisible = true;
- }
- private static void Box(int Width, int Height, int XPos, int YPos)
- {
- for (int i = 0; i < Height; i++)
- {
- Console.SetCursorPosition(XPos, YPos);
- Console.Write(" ".PadRight(Width));
- YPos++;
- }
- }
- private static void DrawImage(int m, int n)
- {
- Console.ResetColor();
- Console.SetCursorPosition(m, n);
- for (int i = 0; i < image.GetLength(0); i++)
- {
- for (int j = 0; j < image.GetLength(1); j++)
- {
- if (image[i, j] == 0)
- {
- n++;
- Console.SetCursorPosition(m, n);
- }
- else if (image[i, j] > 0)
- {
- ChooseColor(image[i, j]);
- Console.Write(" ");
- }
- }
- }
- Console.SetCursorPosition(0, 0);
- }
- private static void ChooseColor(int number)
- {
- //Знаю, что не хорошо так записывать if'ы, но так красивее и выходит меньше строчек..
- if (number == 1) Console.BackgroundColor = ConsoleColor.Black;
- if (number == 2) Console.BackgroundColor = ConsoleColor.Blue;
- if (number == 3) Console.BackgroundColor = ConsoleColor.Cyan;
- if (number == 4) Console.BackgroundColor = ConsoleColor.DarkBlue;
- if (number == 5) Console.BackgroundColor = ConsoleColor.DarkCyan;
- if (number == 6) Console.BackgroundColor = ConsoleColor.DarkGray;
- if (number == 7) Console.BackgroundColor = ConsoleColor.DarkGreen;
- if (number == 8) Console.BackgroundColor = ConsoleColor.DarkMagenta;
- if (number == 9) Console.BackgroundColor = ConsoleColor.DarkRed;
- if (number == 10) Console.BackgroundColor = ConsoleColor.DarkYellow;
- if (number == 11) Console.BackgroundColor = ConsoleColor.Gray;
- if (number == 12) Console.BackgroundColor = ConsoleColor.Green;
- if (number == 13) Console.BackgroundColor = ConsoleColor.Magenta;
- if (number == 14) Console.BackgroundColor = ConsoleColor.Red;
- if (number == 15) Console.BackgroundColor = ConsoleColor.White;
- if (number == 16) Console.BackgroundColor = ConsoleColor.Yellow;
- }
- private static void ChooseImage(int i)
- {
- if (i == 0)
- {
- if (Kitty)
- {
- image = new int[,] //Kitty
- {
- {2 ,1 ,1 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,1 ,1 ,2 ,2 ,0},
- {2 ,1 ,11,1 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,1 ,11,11,1 ,2 ,0},
- {2 ,1 ,11,11,1 ,2 ,2 ,2 ,2 ,2 ,1 ,11,11,11,1 ,2 ,0},
- {2 ,1 ,11,11,11,1 ,1 ,1 ,1 ,1 ,11,11,11,11,1 ,2 ,0},
- {1 ,11,11,11,11,11,11,11,11,11,11,11,11,11,1 ,2 ,0},
- {1 ,11,11,11,11,11,11,11,11,11,11,11,11,11,1 ,2 ,0},
- {1 ,11,11,11,11,11,11,11,11,11,11,11,11,11,11,1 ,0},
- {1 ,11,11,11,15,1 ,11,11,11,11,11,15,1 ,11,11,1 ,0},
- {1 ,11,11,11,1 ,1 ,11,11,11,1 ,11,1 ,1 ,11,11,1 ,0},
- {1 ,11,9 ,9 ,11,11,11,11,11,11,11,11,11,9 ,9 ,1 ,0},
- {1 ,11,9 ,9 ,11,1 ,11,11,1 ,11,11,1 ,11,9 ,9 ,1 ,0},
- {2 ,1 ,11,11,11,11,1 ,1 ,11,1 ,1 ,11,11,11,1 ,2 ,0},
- {2 ,2 ,1 ,11,11,11,11,11,11,11,11,11,11,1 ,2 ,2 ,0},
- {2 ,2 ,2 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,2 ,2 ,2 ,0}
- };
- }
- else
- {
- image = new int[,] //Mario
- {
- {2 ,2 ,2 ,14,14,14,14,14,2 ,2 ,2 ,2 ,0},
- {2 ,2 ,14,14,14,14,14,14,14,14,14,2 ,0},
- {2 ,2 ,9 ,9 ,9 ,15,15,1 ,15,2 ,2 ,2 ,0},
- {2 ,9 ,15,9 ,15,15,15,1 ,15,15,15,2 ,0},
- {2 ,9 ,15,9 ,9 ,15,15,15,9 ,15,15,15,0},
- {2 ,9 ,9 ,15,15,15,15,9 ,9 ,9 ,9 ,2 ,0},
- {2 ,2 ,2 ,15,15,15,15,15,15,15,2 ,2 ,0},
- {2 ,2 ,14,14,4 ,14,14,14,2 ,2 ,2 ,2 ,0},
- {2 ,14,14,14,4 ,14,14,4 ,14,14,14,2 ,0},
- {14,14,14,14,4 ,4 ,4 ,4 ,14,14,14,14,0},
- {15,15,14,4 ,16,4 ,4 ,16,4 ,14,15,15,0},
- {15,15,15,4 ,4 ,4 ,4 ,4 ,4 ,15,15,15,0},
- {15,15,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,15,15,0},
- {2 ,2 ,4 ,4 ,4 ,2 ,2 ,4 ,4 ,4 ,2 ,2 ,0},
- {2 ,9 ,9 ,9 ,2 ,2 ,2 ,2 ,9 ,9 ,9 ,2 ,0},
- {9 ,9 ,9 ,9 ,2 ,2 ,2 ,2 ,9 ,9 ,9 ,9 ,0}
- };
- }
- }
- if (i == 1)
- {
- image = new int[,]
- {
- {15,15,15,15,1 ,0},
- {15,1 ,1 ,1 ,15,0},
- {15,1 ,1 ,1 ,15,0},
- {15,1 ,1 ,1 ,15,0},
- {15,15,15,15,1 ,0},
- };
- }
- if (i == 2)
- {
- image = new int[,]
- {
- {15,15,15,15,0},
- {15,1 ,1 ,15,0},
- {15,1 ,1 ,15,0},
- {15,1 ,1 ,15,0},
- {15,15,15,15,0},
- };
- }
- if (i == 3)
- {
- image = new int[,]
- {
- {15,15,15,15,0},
- {15,1 ,1 ,15,0},
- {15,15,15,15,0},
- {15,1 ,15,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1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,6 ,0},
- {6 ,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 ,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 ,1 ,1 ,6 ,0},
- {6 ,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 ,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 ,1 ,1 ,6 ,0},
- {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}
- };
- }
- }
- private static void MoveCursor()
- {
- Console.SetCursorPosition(x, y);
- if (Console.KeyAvailable)
- {
- ConsoleKey k = Console.ReadKey(true).Key;
- if (k == ConsoleKey.D || k == ConsoleKey.RightArrow)
- {
- x += 2;
- if (x > Console.WindowWidth - 3)
- {
- x = 2;
- }
- }
- if (k == ConsoleKey.A || k == ConsoleKey.LeftArrow)
- {
- x -= 2;
- if (x < 1)
- {
- x = Console.WindowWidth - 4;
- }
- }
- if (k == ConsoleKey.W || k == ConsoleKey.UpArrow)
- {
- y -= 1;
- if (y < 1)
- {
- y = Console.WindowHeight - 2;
- }
- }
- if (k == ConsoleKey.S || k == ConsoleKey.DownArrow)
- {
- y += 1;
- if (y > Console.WindowHeight - 2)
- {
- y = 1;
- }
- }
- if (k == ConsoleKey.Enter || k == ConsoleKey.Spacebar)
- {
- Bottoms();
- }
- }
- }
- private static void Time()
- {
- Console.BackgroundColor = ConsoleColor.Green;
- Console.ForegroundColor = ConsoleColor.Black;
- Console.SetCursorPosition(Console.WindowWidth - 28, Console.WindowHeight - 3);
- Console.Write(DateTime.Now.ToString("dd MMMM yyyy | HH:mm:ss"));
- Console.ResetColor();
- }
- private static void Bottoms()
- {
- if (x <= 10 && y >= Console.WindowHeight - 4 && !StartOpen && !pauseOpen)
- {
- StartOpen = true;
- StartDraw();
- }
- else if (x <= 10 && y >= Console.WindowHeight - 4 && StartOpen)
- {
- StartOpen = false;
- OperatingSystem();
- }
- else if (x <= 26 && (y > Console.WindowHeight - 27) && (y < Console.WindowHeight - 23) && StartOpen)
- {
- FolderOpen = true;
- DrawingOpen = false;
- StartOpen = false;
- PingPongOpen = false;
- OperatingSystem();
- }
- else if (x <= 26 && (y > Console.WindowHeight - 23) && (y < Console.WindowHeight - 19) && StartOpen)
- {
- DrawingOpen = true;
- Drawing = true;
- PingPongOpen = false;
- StartOpen = false;
- OperatingSystem();
- }
- else if (x <= 26 && (y > Console.WindowHeight - 15) && (y < Console.WindowHeight - 11) && StartOpen)
- {
- PlatformerOpen = true;
- DrawingOpen = false;
- Drawing = true;
- PingPongOpen = false;
- StartOpen = false;
- OperatingSystem();
- }
- else if (x == 6 && y >= 7 && y <= 22 && DrawingOpen)
- {
- for (int i = 7; i <= 22; i++)
- {
- if (y == i)
- {
- color = i - 6;
- }
- }
- }
- else if (x >= 64 && x <= 72 && y == 6 && SaveOrLoadOpen)
- {
- Drawing = true;
- SaveOrLoadOpen = false;
- OperatingSystem();
- }
- else if (x >= 64 && x <= 76 && (y == 8 || y == 10 || y == 12) && SaveOrLoadOpen)
- {
- if (SaveDrawing)
- {
- if (y == 8)
- {
- Image1Save = true;
- Array.Copy(DrawingSaveMain, DrawingSave1 = new int[18, 52], DrawingSaveMain.Length);
- }
- if (y == 10)
- {
- Image2Save = true;
- Array.Copy(DrawingSaveMain, DrawingSave2 = new int[18, 52], DrawingSaveMain.Length);
- }
- if (y == 12)
- {
- Image3Save = true;
- Array.Copy(DrawingSaveMain, DrawingSave3 = new int[18, 52], DrawingSaveMain.Length);
- }
- }
- else
- {
- if (y == 8)
- if (Image1Save)
- Array.Copy(DrawingSave1, DrawingSaveMain = new int[18, 52], DrawingSave1.Length);
- if (y == 10)
- if (Image2Save)
- Array.Copy(DrawingSave2, DrawingSaveMain = new int[18, 52], DrawingSave1.Length);
- if (y == 12)
- if (Image3Save)
- Array.Copy(DrawingSave3, DrawingSaveMain = new int[18, 52], DrawingSave1.Length);
- }
- Drawing = true;
- SaveOrLoadOpen = false;
- OperatingSystem();
- }
- else if (x >= 12 && x <= 30 && y == 4 && DrawingOpen && Drawing)
- {
- ResetDrawingSaveMain();
- OperatingSystem();
- }
- else if (x >= 12 && x <= 112 && y >= 6 && y <= 23 && DrawingOpen && Drawing)
- {
- DrawingSaveMain[y - 6, (x - 12) / 2] = color;
- ChooseColor(color);
- Console.Write(" ");
- }
- else if (x >= 40 && x <= 80 && y == 4 && DrawingOpen)
- {
- SaveOrLoadOpen = true;
- if (x >= 40 && x <= 53)
- {
- Drawing = false;
- SaveDrawing = true;
- SaveOrLoadDrawingDraw();
- }
- else if (x >= 66 && x <= 78)
- {
- Drawing = false;
- SaveDrawing = false;
- SaveOrLoadDrawingDraw();
- }
- }
- else if (x <= 26 && (y > Console.WindowHeight - 19) && (y < Console.WindowHeight - 15) && StartOpen)
- {
- PingPongOpen = true;
- DrawingOpen = false;
- FolderOpen = false;
- StartOpen = false;
- OperatingSystem();
- }
- else if (x >= 50 && x <= 70 && y >= 9 && y <= 18 && PingPongOpen && !ExitOpen)
- {
- botLvlHard = (y - 8) * 10;
- if (y == 9) ballSlow = 75;
- if (y == 10) ballSlow = 70;
- if (y == 11) ballSlow = 65;
- if (y == 12) ballSlow = 60;
- if (y == 13) ballSlow = 55;
- if (y == 14) ballSlow = 50;
- if (y == 15) ballSlow = 45;
- if (y == 16) ballSlow = 40;
- if (y == 17) ballSlow = 35;
- if (y == 18) ballSlow = 30;
- string botName = botsName[y - 9];
- Console.BackgroundColor = ConsoleColor.White;
- Console.ForegroundColor = ConsoleColor.Black;
- Console.SetCursorPosition(66, 4);
- Console.Write(botName);
- PingPong();
- }
- else if (x >= Console.WindowWidth - 18 && x <= Console.WindowWidth - 6 && y == Console.WindowHeight - 28 && PingPongOpen)
- {
- PingPongOpen = false;
- OperatingSystem();
- }
- else if (x <= 26 && (y > Console.WindowHeight - 8) && (y < Console.WindowHeight - 4) && StartOpen)
- {
- ExitOpen = true;
- StartOpen = false;
- OperatingSystem();
- }
- else if (x >= Console.WindowWidth - 18 && x <= Console.WindowWidth - 6 && y == Console.WindowHeight - 28 && FolderOpen)
- {
- FolderOpen = false;
- OperatingSystem();
- }
- else if (x >= Console.WindowWidth - 18 && x <= Console.WindowWidth - 6 && y == 2 && DrawingOpen)
- {
- SaveOrLoadOpen = false;
- DrawingOpen = false;
- OperatingSystem();
- }
- else if (x >= Console.WindowWidth - 18 && x <= Console.WindowWidth - 6 && y == 2 && PlatformerOpen)
- {
- PlatformerOpen = false;
- pauseOpen = false;
- OperatingSystem();
- }
- else if (x >= Console.WindowWidth - 74 && x <= Console.WindowWidth - 66 && y >= 16 && y <= Console.WindowHeight - 12 && !ExitOpen && pauseOpen)
- {
- pauseOpen = false;
- PlatformerOpen = false;
- OperatingSystem();
- }
- else if (x >= Console.WindowWidth - 56 && x <= Console.WindowWidth - 48 && y >= 16 && y <= Console.WindowHeight - 12 && !ExitOpen && pauseOpen)
- {
- pauseOpen = false;
- PlatformerGameplay();
- }
- else if (x >= Console.WindowWidth - 74 && x <= Console.WindowWidth - 66 && y >= 16 && y <= Console.WindowHeight - 12 && ExitOpen)
- {
- ExitOpen = false;
- OperatingSystem();
- }
- else if (x >= Console.WindowWidth - 56 && x <= Console.WindowWidth - 48 && y >= 16 && y <= Console.WindowHeight - 12 && ExitOpen)
- {
- System.Environment.Exit(1);
- }
- }
- private static void UIDraw()
- {
- Console.BackgroundColor = ConsoleColor.Blue;
- Box(Console.WindowWidth - 4, Console.WindowHeight - 5, 2, 1);
- Console.BackgroundColor = ConsoleColor.DarkCyan;
- Box(Console.WindowWidth - 43, 3, 11, (Console.WindowHeight - 4));
- for (int i = 1; i <= 3; i++)
- {
- Console.SetCursorPosition(12, Console.WindowHeight - i - 1);
- Console.Write("║");
- }
- Console.BackgroundColor = ConsoleColor.Green;
- Box(9, 3, 2, (Console.WindowHeight - 4));
- Box(30, 3, (Console.WindowWidth - 32), (Console.WindowHeight - 4));
- Console.ForegroundColor = ConsoleColor.Black;
- Console.SetCursorPosition(4, Console.WindowHeight - 3);
- Console.Write("Старт");
- if (!FolderOpen && !DrawingOpen && !ExitOpen && !PingPongOpen)
- {
- ChooseImage(0);
- DrawImage((Console.WindowWidth / 2 - 16), (Console.WindowHeight - 18) / 2);
- }
- if (StartOpen)
- {
- StartDraw();
- }
- if (FolderOpen)
- {
- FolderDraw();
- }
- if (DrawingOpen)
- {
- DrawingDraw();
- }
- if (PingPongOpen)
- {
- PingPongDraw();
- }
- if (PlatformerOpen)
- {
- Platformer();
- }
- if (ExitOpen)
- {
- ExitDraw();
- }
- Console.BackgroundColor = ConsoleColor.Black;
- }
- private static void StartDraw()
- {
- Console.BackgroundColor = ConsoleColor.Black;
- Box(26, 1, 2, Console.WindowHeight - 23);
- Console.ForegroundColor = ConsoleColor.White;
- Console.SetCursorPosition(2, Console.WindowHeight - 28);
- Console.Write("USER PC DOORS OS");
- Console.BackgroundColor = ConsoleColor.White;
- Box(26, Console.WindowHeight - 10, 2, Console.WindowHeight - 27);
- Console.BackgroundColor = ConsoleColor.Red;
- Box(26, 3, 2, Console.WindowHeight - 7);
- Console.ForegroundColor = ConsoleColor.Black;
- Console.SetCursorPosition(6, Console.WindowHeight - 6);
- Console.Write("Завершение работы");
- Console.BackgroundColor = ConsoleColor.Yellow;
- Box(26, 3, 2, Console.WindowHeight - 26);
- Console.SetCursorPosition(6, Console.WindowHeight - 25);
- Console.Write("Папка с файлами");
- Console.BackgroundColor = ConsoleColor.Cyan;
- Box(26, 3, 2, Console.WindowHeight - 22);
- Console.SetCursorPosition(6, Console.WindowHeight - 21);
- Console.Write("Рисовалка");
- Console.BackgroundColor = ConsoleColor.Green;
- Box(26, 3, 2, 12);
- Console.SetCursorPosition(6, 13);
- Console.Write("Пинг-Понг");
- Console.BackgroundColor = ConsoleColor.DarkGray;
- Box(26, 3, 2, 16);
- Console.SetCursorPosition(6, 17);
- Console.Write("Платформер");
- }
- private static void ExitDraw()
- {
- Console.BackgroundColor = ConsoleColor.Black;
- Box(32, 3, (Console.WindowWidth - 32) / 2, (Console.WindowHeight - 10) / 2);
- Console.ForegroundColor = ConsoleColor.White;
- Console.SetCursorPosition((Console.WindowWidth - 20) / 2, (Console.WindowHeight - 8) / 2);
- Console.Write("Выключить Doors OS?");
- Console.BackgroundColor = ConsoleColor.Cyan;
- Box(32, 7, (Console.WindowWidth - 32) / 2, Console.WindowHeight - 17);
- Console.BackgroundColor = ConsoleColor.Red;
- Box(10, 3, Console.WindowWidth - 74, Console.WindowHeight - 14);
- Console.ForegroundColor = ConsoleColor.Black;
- Console.SetCursorPosition(Console.WindowWidth - 71, Console.WindowHeight - 13);
- Console.Write("Нет");
- Console.BackgroundColor = ConsoleColor.Green;
- Box(10, 3, Console.WindowWidth - 56, Console.WindowHeight - 14);
- Console.SetCursorPosition(Console.WindowWidth - 52, Console.WindowHeight - 13);
- Console.Write("Да");
- }
- private static void FolderDraw()
- {
- Console.BackgroundColor = ConsoleColor.Black;
- Box(Console.WindowWidth - 8, 1, 4, Console.WindowHeight - 28);
- Console.ForegroundColor = ConsoleColor.White;
- Console.SetCursorPosition(4, Console.WindowHeight - 28);
- Console.Write("Папка с файлами");
- Console.BackgroundColor = ConsoleColor.Red;
- Box(14, 1, Console.WindowWidth - 18, Console.WindowHeight - 28);
- Console.ForegroundColor = ConsoleColor.Black;
- Console.SetCursorPosition(Console.WindowWidth - 16, Console.WindowHeight - 28);
- Console.Write("Закрыть[X]");
- Console.BackgroundColor = ConsoleColor.White;
- Box(Console.WindowWidth - 8, Console.WindowHeight - 8, 4, Console.WindowHeight - 27);
- Console.ForegroundColor = ConsoleColor.Black;
- Console.SetCursorPosition(8, Console.WindowHeight - 26);
- Console.Write("Файлов и функционала пока нет, но Вы там держитесь!");
- }
- private static void DrawingDraw()
- {
- Console.BackgroundColor = ConsoleColor.Black;
- Console.ForegroundColor = ConsoleColor.Gray;
- Console.SetCursorPosition(4, 2);
- Console.Write("Рисовалка".PadRight(98));
- Console.BackgroundColor = ConsoleColor.Red;
- Console.ForegroundColor = ConsoleColor.Black;
- Console.SetCursorPosition(102, 2);
- Console.Write(" Закрыть[X] ");
- Console.BackgroundColor = ConsoleColor.Gray;
- Box(112, 22, 4, 3);
- Console.SetCursorPosition(5, 4);
- Console.Write("Цвет:");
- Console.SetCursorPosition(5, 6);
- Console.Write("╔══╗");
- for (int i = 1; i <= 16; i++)
- {
- Console.SetCursorPosition(5, 6 + i);
- Console.Write("║ ║");
- }
- Console.SetCursorPosition(5, 23);
- Console.Write("╚══╝");
- Console.BackgroundColor = ConsoleColor.Black;
- Console.ForegroundColor = ConsoleColor.White;
- Console.SetCursorPosition(12, 4);
- Console.Write(" Очистить полотно ");
- Console.SetCursorPosition(40, 4);
- Console.Write(" Сохранить ");
- Console.SetCursorPosition(66, 4);
- Console.Write(" Загрузить ");
- ChooseImage(5);
- DrawImage(6, 7);
- ChooseImage(6);
- DrawImage(12, 6);
- if (SaveOrLoadOpen)
- {
- SaveOrLoadDrawingDraw();
- }
- }
- private static void SaveOrLoadDrawingDraw()
- {
- Console.BackgroundColor = ConsoleColor.DarkCyan;
- Box(40, 9, 40, 5);
- string chooseText;
- string chooseCell;
- string SaveOrLoad;
- if (SaveDrawing)
- {
- chooseText = "ячейки ";
- chooseCell = "ячейка ";
- SaveOrLoad = " Сохранить ";
- }
- else
- {
- chooseText = "картинки ";
- chooseCell = "картинка ";
- SaveOrLoad = " Загрузить ";
- }
- Console.ForegroundColor = ConsoleColor.White;
- Console.SetCursorPosition(42, 6);
- Console.Write("Выбор {0}", chooseText);
- Console.BackgroundColor = ConsoleColor.White;
- Console.ForegroundColor = ConsoleColor.Black;
- for (int i = 1; i <= 3; i++)
- {
- Console.SetCursorPosition(42, 6 + i * 2);
- Console.Write("{0} {1}", i, chooseCell);
- Console.SetCursorPosition(64, 6 + i * 2);
- Console.Write(SaveOrLoad);
- }
- Console.SetCursorPosition(64, 6);
- Console.Write(" Отмена ");
- }
- private static void UpdateDraw()
- {
- Console.CursorVisible = false;
- Console.BackgroundColor = ConsoleColor.Blue;
- Box(Console.WindowWidth - 4, Console.WindowHeight - 2, 2, 1);
- Console.ForegroundColor = ConsoleColor.White;
- string UpdateDoorsOS = "Обновление Doors OS";
- string EverythingIsFine = "Все нормально. Это может занять некоторое время.";
- Console.SetCursorPosition((Console.WindowWidth - UpdateDoorsOS.Length) / 2, (Console.WindowHeight / 2) - 10);
- Console.WriteLine(UpdateDoorsOS);
- Console.SetCursorPosition((Console.WindowWidth - EverythingIsFine.Length) / 2, (Console.WindowHeight / 2) - 8);
- Console.WriteLine(EverythingIsFine);
- int ProgressPersents = 0;
- while (ProgressPersents < 100)
- {
- Random r = new Random();
- int ProgressPlus = r.Next(0, 6);
- if (ProgressPersents > 95)
- {
- ProgressPlus = 100 - ProgressPersents;
- }
- ProgressPersents += ProgressPlus;
- string Progress = "Выполнено: " + ProgressPersents + " % ";
- Console.SetCursorPosition((Console.WindowWidth - Progress.Length) / 2, (Console.WindowHeight / 2) - 4);
- Console.WriteLine(Progress);
- Thread.Sleep(400);
- Console.CursorVisible = true;
- }
- }
- private static void Update()
- {
- if ((timeStart + 2) <= TimeCheck() && ToUpDate)
- {
- Kitty = true;
- ToUpDate = false;
- UpdateDraw();
- Main();
- }
- }
- private static void OperatingSystem()
- {
- UIDraw();
- //AnimalsAndHunters();
- while (true)
- {
- Time();
- MoveCursor();
- Update();
- }
- }
- //--------------------------------------
- private static void PingPongDraw()
- {
- Console.BackgroundColor = ConsoleColor.Black;
- Console.ForegroundColor = ConsoleColor.Gray;
- Console.SetCursorPosition(4, 2);
- Console.Write("Пинг-Понг".PadRight(98));
- Console.BackgroundColor = ConsoleColor.Red;
- Console.ForegroundColor = ConsoleColor.Black;
- Console.SetCursorPosition(102, 2);
- Console.Write(" Закрыть[X] ");
- Console.BackgroundColor = ConsoleColor.White;
- Box(112, 22, 4, 3);
- Console.BackgroundColor = ConsoleColor.Black;
- Box(4, 2, 6, 4);
- Box(4, 2, 6, 22);
- Box(4, 2, 110, 4);
- Box(4, 2, 110, 22);
- Console.BackgroundColor = ConsoleColor.Green;
- Box(104, 18, 8, 5);
- ChooseBot();
- }
- private static void PingPong()
- {
- PingPongSettings();
- Console.CursorVisible = false;
- while (true)
- {
- Time();
- PlayerMove();
- BotMove();
- MoveBall();
- Console.BackgroundColor = ConsoleColor.Green;
- Console.ForegroundColor = ConsoleColor.Black;
- Box(104, 18, 8, 5);
- DrawPlayer();
- DrawBot();
- Console.SetCursorPosition(ballPosX, ballPosY);
- Console.Write(" ");
- PrintResult();
- Thread.Sleep(ballSlow);
- }
- }
- private static void ChooseBot()
- {
- botsName = new List<string>()
- {"Неудачник", "Новичок", "Середнячок", "Опытный", "Тот чел с района",
- "Городская легенда", "Чемпион Гондураса", "Жека Чан", "Мастер унижения", "Борис Лихач"};
- Console.BackgroundColor = ConsoleColor.Black;
- Console.ForegroundColor = ConsoleColor.White;
- Console.SetCursorPosition(50, 6);
- Console.Write("Выберите противника: ");
- int i = 0;
- foreach (string s in botsName)
- {
- Console.SetCursorPosition(50, 9 + i);
- Console.Write("{0}. {1}".PadRight(27 - s.Length), i, s);
- i++;
- }
- }
- private static void PingPongSettings()
- {
- ResetBall();
- playerPos = Console.WindowHeight / 2 - playerpadSize / 2;
- botPos = Console.WindowHeight / 2 - botpadSize / 2;
- playerpadSize = 5;
- botpadSize = 5;
- playerResult = 0;
- botResult = 0;
- ballDirectionUp = true;
- ballDirectionRight = true;
- Console.ForegroundColor = ConsoleColor.Black;
- Console.BackgroundColor = ConsoleColor.White;
- Console.SetCursorPosition(50, 4);
- Console.Write("Вы");
- Console.SetCursorPosition(30, 23);
- Console.Write("Нажмите Esc, чтобы закончить раунд и выбрать другого соперника");
- }
- private static void ResetBall()
- {
- ballPosX = Console.WindowWidth / 2;
- ballPosY = Console.WindowHeight / 2;
- }
- private static void DrawPlayer()
- {
- Console.BackgroundColor = ConsoleColor.Black;
- Box(2, playerpadSize, 8, playerPos);
- }
- private static void DrawBot()
- {
- Box(2, playerpadSize, 110, botPos);
- }
- private static void PrintResult()
- {
- Console.BackgroundColor = ConsoleColor.White;
- Console.SetCursorPosition(Console.WindowWidth / 2 - 3, 4);
- Console.WriteLine("{0} - {1}", playerResult, botResult);
- Console.ResetColor();
- }
- private static void MovePlayerUp()
- {
- if (playerPos > 5)
- {
- playerPos--;
- }
- }
- private static void MovePlayerDown()
- {
- if (playerPos < 23 - playerpadSize)
- {
- playerPos++;
- }
- }
- private static void MoveBotUp()
- {
- if (botPos > 5)
- {
- botPos--;
- }
- }
- private static void MoveBotDown()
- {
- if (botPos < 23 - botpadSize)
- {
- botPos++;
- }
- }
- private static void PlayerMove()
- {
- if (Console.KeyAvailable)
- {
- Console.BackgroundColor = ConsoleColor.Green;
- Console.ForegroundColor = ConsoleColor.Green;
- ConsoleKeyInfo keyInfo = Console.ReadKey();
- if (keyInfo.Key == ConsoleKey.UpArrow || keyInfo.Key == ConsoleKey.W)
- {
- MovePlayerUp();
- }
- if (keyInfo.Key == ConsoleKey.DownArrow || keyInfo.Key == ConsoleKey.S)
- {
- MovePlayerDown();
- }
- if (keyInfo.Key == ConsoleKey.Escape)
- {
- Console.CursorVisible = true;
- OperatingSystem();
- }
- }
- }
- private static void BotMove()
- {
- int randomNumber = randomGenerator.Next(1, 100);
- if (randomNumber < botLvlHard)
- {
- if (ballDirectionUp == true)
- {
- MoveBotUp();
- }
- else
- {
- MoveBotDown();
- }
- }
- }
- private static void MoveBall()
- {
- if (ballPosY == 5)
- {
- ballDirectionUp = false;
- }
- if (ballPosY == 22)
- {
- ballDirectionUp = true;
- }
- if (ballPosX == 110)
- {
- ResetBall();
- ballDirectionUp = false;
- ballDirectionRight = false;
- playerResult++;
- }
- if (ballPosX == 8)
- {
- ResetBall();
- ballDirectionUp = true;
- ballDirectionRight = true;
- botResult++;
- }
- if (ballPosX < 11)
- {
- if (ballPosY >= playerPos && ballPosY < playerPos + playerpadSize)
- {
- ballDirectionRight = true;
- }
- }
- if (ballPosX >= 108)
- {
- if (ballPosY >= botPos && ballPosY < botPos + botpadSize)
- {
- ballDirectionRight = false;
- }
- }
- if (ballDirectionUp)
- {
- ballPosY--;
- }
- else
- {
- ballPosY++;
- }
- if (ballDirectionRight)
- {
- ballPosX++;
- }
- else
- {
- ballPosX--;
- }
- }
- #endregion
- //--------------------------------------------
- //-----------------Платформер-----------------
- //--------------------------------------------
- private static void Platformer()
- {
- PlatformerSettings();
- PlatformerTutorial();
- PlatformerGameplay();
- }
- private static void PlatformerSettings()
- {
- xPosPlayer = 10;
- yPosPlayer = 10;
- playerHealth = 100;
- PlatformerDraw();
- ChooseImage(7);
- pauseOpen = false;
- playerDirectionRight = true;
- playerJump = false;
- isGrounded = false;
- canJump = false;
- otherGravity = false;
- nextLvlNumber = 2;
- }
- private static void PlatformerGameplay()
- {
- while (true)
- {
- Time();
- HealthOutput();
- GroundTest();
- MovePlayer();
- DrawImage(6, 4);
- PlayerDraw();
- Gravitation();
- Thread.Sleep(50);
- }
- }
- private static void PlatformerTutorial()
- {
- Console.SetCursorPosition(54, 5);
- Console.ForegroundColor = ConsoleColor.White;
- Console.Write("Обучение");
- Console.SetCursorPosition(10, 7);
- Console.Write("Управление персонажем - W-A-S-D, Esc - пауза.");
- Console.SetCursorPosition(10, 9);
- Console.Write("Серые участки карты - это стены, голубые - лестницы, красные - раскаленный пол(наносит урон),");
- Console.SetCursorPosition(10, 10);
- Console.Write("зеленые - выход в другой уровень.");
- Console.SetCursorPosition(10, 12);
- Console.Write("Если стать на белый участок карты и нажать пробел, поменяется гравитация.");
- Console.SetCursorPosition(10, 20);
- Console.Write("Удачи. Нажми любую кнопку чтобы продолжить...");
- Time();
- Console.SetCursorPosition(10, 21);
- Console.ReadKey();
- }
- private static void NextLevel()
- {
- int[,] playerPos = new int[,] { { 16, 5 }, { 50, 5 } };
- if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] == 12 || image[yPosPlayer - 3, (xPosPlayer - 6) / 2] == 12 || image[yPosPlayer - 4, (xPosPlayer - 6) / 2] == 12)
- {
- xPosPlayer = playerPos[nextLvlNumber - 2, 0];
- yPosPlayer = playerPos[nextLvlNumber - 2, 1];
- ChooseImage(nextLvlNumber + 6);
- otherGravity = false;
- nextLvlNumber++;
- playerHealth = 100;
- }
- }
- private static void MovePlayer()
- {
- if (Console.KeyAvailable)
- {
- Console.SetCursorPosition(xPosPlayer, yPosPlayer);
- ConsoleKey k = Console.ReadKey(true).Key;
- if (k == ConsoleKey.D || k == ConsoleKey.RightArrow)
- {
- xPosPlayer += 2;
- playerDirectionRight = true;
- NextLevel();
- if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] == 3 && image[yPosPlayer - 3, (xPosPlayer - 6) / 2] == 3 && image[yPosPlayer - 4, (xPosPlayer - 6) / 2] == 3)
- {
- }
- else if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] == 14 || image[yPosPlayer - 3, (xPosPlayer - 6) / 2] == 14 || image[yPosPlayer - 4, (xPosPlayer - 6) / 2] == 14)
- {
- playerHealth -= 5;
- xPosPlayer -= 2;
- }
- else if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] != 1 || image[yPosPlayer - 3, (xPosPlayer - 6) / 2] != 1 || image[yPosPlayer - 4, (xPosPlayer - 6) / 2] != 1)
- {
- xPosPlayer -= 2;
- }
- }
- if (k == ConsoleKey.A || k == ConsoleKey.LeftArrow)
- {
- xPosPlayer -= 2;
- playerDirectionRight = false;
- NextLevel();
- if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] == 3 && image[yPosPlayer - 3, (xPosPlayer - 6) / 2] == 3 && image[yPosPlayer - 4, (xPosPlayer - 6) / 2] == 3)
- {
- }
- else if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] == 14 || image[yPosPlayer - 3, (xPosPlayer - 6) / 2] == 14 || image[yPosPlayer - 4, (xPosPlayer - 6) / 2] == 14)
- {
- playerHealth -= 5;
- xPosPlayer -= 2;
- }
- else if (image[yPosPlayer - 2, (xPosPlayer - 6) / 2] != 1 || image[yPosPlayer - 3, (xPosPlayer - 6) / 2] != 1 || image[yPosPlayer - 4, (xPosPlayer - 6) / 2] != 1)
- {
- xPosPlayer += 2;
- }
- }
- if ((k == ConsoleKey.W || k == ConsoleKey.UpArrow))
- {
- if ((image[yPosPlayer - 2, (xPosPlayer - 6) / 2] == 3 || image[yPosPlayer - 5, (xPosPlayer - 6) / 2] == 3) && image[yPosPlayer - 5, (xPosPlayer - 6) / 2] != 6)
- {
- yPosPlayer -= 1;
- }
- else if (!otherGravity && canJump && isGrounded)
- {
- jumpHeight = 3;
- playerJump = true;
- }
- }
- if (k == ConsoleKey.S || k == ConsoleKey.DownArrow)
- {
- if (image[yPosPlayer - 1, (xPosPlayer - 6) / 2] == 3)
- {
- yPosPlayer += 1;
- }
- else if (otherGravity && canJump && isGrounded)
- {
- jumpHeight = 3;
- playerJump = true;
- }
- }
- if (k == ConsoleKey.Spacebar)
- {
- if (!otherGravity)
- {
- if (image[yPosPlayer - 1, (xPosPlayer - 6) / 2] == 15)
- {
- otherGravity = true;
- }
- }
- else
- {
- if (image[yPosPlayer - 5, (xPosPlayer - 6) / 2] == 15)
- {
- otherGravity = false;
- }
- }
- }
- if (k == ConsoleKey.Escape)
- {
- Console.CursorVisible = true;
- pauseOpen = true;
- PauseMenu();
- }
- }
- }
- private static void HealthOutput()
- {
- Console.BackgroundColor = ConsoleColor.White;
- Console.ForegroundColor = ConsoleColor.Black;
- Console.SetCursorPosition(6, 24);
- Console.Write("Здоровье: {0} ", playerHealth);
- if (playerHealth <= 0)
- {
- OperatingSystem();
- }
- }
- private static void PauseMenu()
- {
- Console.BackgroundColor = ConsoleColor.Black;
- Box(32, 3, (Console.WindowWidth - 32) / 2, (Console.WindowHeight - 10) / 2);
- Console.ForegroundColor = ConsoleColor.White;
- Console.SetCursorPosition((Console.WindowWidth - 24) / 2, (Console.WindowHeight - 8) / 2);
- Console.Write("Пауза. Продолжить игру?");
- Console.BackgroundColor = ConsoleColor.Cyan;
- Box(32, 7, (Console.WindowWidth - 32) / 2, Console.WindowHeight - 17);
- Console.BackgroundColor = ConsoleColor.Red;
- Box(10, 3, Console.WindowWidth - 74, Console.WindowHeight - 14);
- Console.ForegroundColor = ConsoleColor.Black;
- Console.SetCursorPosition(Console.WindowWidth - 71, Console.WindowHeight - 13);
- Console.Write("Нет");
- Console.BackgroundColor = ConsoleColor.Green;
- Box(10, 3, Console.WindowWidth - 56, Console.WindowHeight - 14);
- Console.SetCursorPosition(Console.WindowWidth - 52, Console.WindowHeight - 13);
- Console.Write("Да");
- while (true)
- {
- Time();
- MoveCursor();
- }
- }
- private static void GroundTest()
- {
- if (!otherGravity)
- {
- if (image[yPosPlayer - 1, (xPosPlayer - 6) / 2] == 1)
- {
- isGrounded = false;
- }
- else
- {
- isGrounded = true;
- if (image[yPosPlayer - 1, (xPosPlayer - 6) / 2] == 14)
- {
- playerHealth -= 5;
- }
- }
- }
- else
- {
- if (image[yPosPlayer - 5, (xPosPlayer - 6) / 2] == 1)
- {
- isGrounded = false;
- }
- else
- {
- isGrounded = true;
- if (image[yPosPlayer - 5, (xPosPlayer - 6) / 2] == 14)
- {
- playerHealth -= 5;
- }
- }
- }
- }
- private static void Gravitation()
- {
- if (playerJump)
- {
- if (!otherGravity)
- {
- if (image[yPosPlayer - 5, (xPosPlayer - 6) / 2] == 1)
- {
- yPosPlayer--;
- }
- else
- {
- if (image[yPosPlayer - 5, (xPosPlayer - 6) / 2] == 14)
- {
- playerHealth -= 10;
- }
- playerJump = false;
- }
- }
- else
- {
- if (image[yPosPlayer - 1, (xPosPlayer - 6) / 2] == 1)
- {
- yPosPlayer++;
- }
- else
- {
- if (image[yPosPlayer - 1, (xPosPlayer - 6) / 2] == 14)
- {
- playerHealth -= 10;
- }
- playerJump = false;
- }
- }
- if (jumpHeight == 0)
- {
- playerJump = false;
- }
- jumpHeight--;
- }
- else if (isGrounded)
- {
- canJump = true;
- }
- else
- {
- if (!otherGravity)
- {
- yPosPlayer++;
- }
- else
- {
- yPosPlayer--;
- }
- }
- NextLevel();
- }
- private static void PlatformerDraw()
- {
- Console.BackgroundColor = ConsoleColor.Black;
- Console.ForegroundColor = ConsoleColor.Gray;
- Console.SetCursorPosition(4, 2);
- Console.Write("Платформер".PadRight(98));
- Console.BackgroundColor = ConsoleColor.Red;
- Console.ForegroundColor = ConsoleColor.Black;
- Console.SetCursorPosition(102, 2);
- Console.Write(" Закрыть[X] ");
- Console.BackgroundColor = ConsoleColor.White;
- Box(112, 22, 4, 3);
- Console.BackgroundColor = ConsoleColor.Black;
- Box(108, 20, 6, 4);
- }
- private static void PlayerDraw()
- {
- Console.CursorVisible = false;
- Console.SetCursorPosition(xPosPlayer, yPosPlayer);
- Console.ResetColor();
- if (!otherGravity)
- {
- if (playerDirectionRight)
- {
- Console.Write(">>");
- }
- else
- {
- Console.Write("<<");
- }
- Console.SetCursorPosition(xPosPlayer, yPosPlayer + 2);
- Console.Write("/\\");
- }
- else
- {
- Console.Write("\\/");
- Console.SetCursorPosition(xPosPlayer, yPosPlayer + 2);
- if (playerDirectionRight)
- {
- Console.Write(">>");
- }
- else
- {
- Console.Write("<<");
- }
- }
- Console.SetCursorPosition(xPosPlayer, yPosPlayer + 1);
- Console.Write("██");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement