Example #1
0
        static void Main(string[] args)
        {
            GameState gameState = new GameState();

            while (true)
            {
                gameState.Draw();

                ConsoleKeyInfo consoleKeyInfo = Console.ReadKey();

                gameState.ProcessKey(consoleKeyInfo);
            }
        }
Example #2
0
        static void DoIt()
        {
            while (true)
            {
                consoleKeyInfo = Console.ReadKey();

                switch (consoleKeyInfo.Key)
                {
                case ConsoleKey.F2:
                    gameState.Save();
                    break;

                case ConsoleKey.F3:
                    Console.Clear();
                    gameState = gameState.Load();
                    gameState.Run();
                    break;

                default:
                    gameState.ProcessKey(consoleKeyInfo);
                    break;
                }
            }
        }