private void Erase(int x, int y, int Pieza) { for (int i = 0; i < 4; i++) { ConsoleFunctions.WriteConsole(x + Forma[Pieza, Rotacion, i].X, y + Forma[Pieza, Rotacion, i].Y, " "); } }
private void Draw(int x, int y, int Pieza) { for (int i = 0; i < 4; i++) { ConsoleFunctions.WriteConsole(x + Forma[Pieza, Rotacion, i].X, y + Forma[Pieza, Rotacion, i].Y, Colors[Pieza], "\x8"); } UpdatePieceDimentions(); Available = true; }
public static void PauseGame(Thread GamePlay, ref bool Quit, ref Piezas ObPieza) { ConsoleFunctions.CHAR_INFO[] Buffer = new ConsoleFunctions.CHAR_INFO[11 * 24]; ConsoleFunctions.CHAR_INFO[] BufferNext = new ConsoleFunctions.CHAR_INFO[4 * 4]; GamePlay.Suspend(); Playground.Pause(); Buffer = ConsoleFunctions.ReadConsoleOutput(1, 1, 11, 24); BufferNext = ConsoleFunctions.ReadConsoleOutput(15, 1, 4, 4); Console.Title = Console.Title + " (Paused)"; afliw.Clear(1, 24, 1, 11); afliw.Clear(1, 5, 15, 19); ConsoleFunctions.WriteConsole(3, 1, (ushort)ConsoleColor.DarkCyan, "Paused"); for (int i = 0; i < 11; i++) { Console.MoveBufferArea(3, 1 + i, 6, 1, 3, 2 + i); Thread.Sleep(300 / (5 * (i + 1))); } for (int i = 0; i < 3; i++) { Console.MoveBufferArea(3, 12 - i, 6, 1, 3, 11 - i); Thread.Sleep(30 * (i + 1)); } Thread.Sleep(20); for (int i = 0; i < 3; i++) { Console.MoveBufferArea(3, 9 + i, 6, 1, 3, 10 + i); Thread.Sleep(30 * (i + 1)); } int Option = 2; Menu PauseMenu = new Menu(2, 14, -1, "Gray"); PauseMenu.AddItem(true, "Continue", "Restart", "Config", "Quit"); ConsoleFunctions.FlushConsoleInputBuffer(); do { Option = PauseMenu.DrawMenu(0); switch (Option) { case 0: UnPauseGame(GamePlay, Buffer, BufferNext); break; case 1: UnPauseGame(GamePlay, Buffer, BufferNext); RestartGame(ref ObPieza); break; case 2: Options(); break; case 3: Quit = true; break; } }while(Option == 2); }