static void Main(string[] args) { GameState game = new GameState(); game.ShowBanner(); game.GetInput(); Console.Clear(); game.Draw(); game.Run(); while (!gameover) { ConsoleKeyInfo consoleKeyInfo = Console.ReadKey(); if (consoleKeyInfo.Key == ConsoleKey.K) { Serialize(game); } else if (consoleKeyInfo.Key == ConsoleKey.L) { game.Stop(); game = Deserialize(); game.Draw(); game.Run(); } else { game.ProcessKeyEvent(consoleKeyInfo); } } }
static void Main(string[] args) { GameState game = new GameState(); player.SetName(); game.Run(); while (true) { player.Draw(); ConsoleKeyInfo consoleKeyInfo = Console.ReadKey(); if (consoleKeyInfo.Key == ConsoleKey.F2) { Serialize(game); } else if (consoleKeyInfo.Key == ConsoleKey.F3) { game.Stop(); game = Deserialize(); game.Run(); } else { game.ProcessKeyEvent(consoleKeyInfo); } } }
static void Main(string[] args) { GameState game = new GameState(); project1 gg = new project1(); while (true) { Console.SetCursorPosition(1, 20); cpp(); Console.SetCursorPosition(24, 20); gg.anton(Console.ReadLine()); Console.SetCursorPosition(1, 20); Console.WriteLine(" "); break; } game.Run(gg.str()); while (true) { ConsoleKeyInfo consoleKeyInfo = Console.ReadKey(); if (consoleKeyInfo.Key == ConsoleKey.F2) { Serialize(game); } else if (consoleKeyInfo.Key == ConsoleKey.F3) { game.Stop(); game = Deserialize(); game.Run(gg.str()); } else { game.ProcessKeyEvent(consoleKeyInfo); } } }