public static void start() //jstris에서 플레이 { Console.Clear(); Console.WriteLine("______________________________"); Console.WriteLine(" 1. 20Line 플레이"); Console.WriteLine(" 2. 1 vs 少 플레이"); Console.WriteLine(" 3. 1 vs 多 플레이"); Console.WriteLine("______________________________"); int k = 0; while (true) { if (Console.ReadKey(true).Key == ConsoleKey.D1) { k = 1; break; } if (Console.ReadKey(true).Key == ConsoleKey.D2) { k = 2; break; } if (Console.ReadKey(true).Key == ConsoleKey.D3) { k = 3; break; } } Console.WriteLine(k + " selected"); Color c = new Color(); while (!(c.R == 203 && c.G == 214 && c.B == 0)) { c = Getpixel.GetColorAt(new Point(704, 473)); Thread.Sleep(100); } Console.WriteLine("시작\n"); if (k == 1) { P1(); } if (k == 2) { P2(); } if (k == 3) { P3(); } return; }
public static void Read() { //Thread.Sleep(500); //temporary Color color; int i, j; color = Getpixel.GetColorAt(new Point(895, 206)); if (color.R + color.G + color.B < 200) { color = Getpixel.GetColorAt(new Point(897, 230)); } // Print the RGB information of the pixel color //Console.WriteLine(color.R.ToString() + " " + color.G.ToString() + " " + color.B.ToString()); for (i = 0; i < 7; i++) { //Get tetris block number if (color == C[i]) { CurBlockNum = i; } } color = Getpixel.GetColorAt(new Point(517, 206)); if (color.R + color.G + color.B < 200) { color = Getpixel.GetColorAt(new Point(517, 230)); } // Print the RGB information of the pixel color //Console.WriteLine(color.R.ToString() + " " + color.G.ToString() + " " + color.B.ToString()); for (i = 0; i < 7; i++) { //Get tetris block number if (color == C[i]) { HoldBlockNum = i; } } color = Getpixel.GetColorAt(new Point(897, 276)); if (color.R + color.G + color.B < 200) { color = Getpixel.GetColorAt(new Point(897, 305)); } // Print the RGB information of the pixel color //Console.WriteLine(color.R.ToString() + " " + color.G.ToString() + " " + color.B.ToString()); for (i = 0; i < 7; i++) { //Get tetris block number if (color == C[i]) { NextBlockNum = i; } } }
public static void TRead() { Color color; int i, j; color = Getpixel.GetColorAt(new Point(693, 180)); if (color.R + color.G + color.B < 200) { color = Getpixel.GetColorAt(new Point(693, 204)); } // Print the RGB information of the pixel color //Console.WriteLine(color.R.ToString() + " " + color.G.ToString() + " " + color.B.ToString()); for (i = 0; i < 7; i++) { //Get tetris block number if (color == C[i]) { CurBlockNum = i; } } }