Example #1
0
        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);
                }
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            GameState gameState = new GameState();

            if (!end)
            {
                gameState.Run();
            }

            while (!end)
            {
                gameState.Draw();
                ConsoleKeyInfo consoleKeyInfo = Console.ReadKey();
                switch (consoleKeyInfo.Key)
                {
                case ConsoleKey.F2:
                    gameState.Save();
                    break;

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

                default:
                    gameState.PressedKey(consoleKeyInfo);
                    break;
                }
            }
        }
Example #3
0
        static void Main(string[] args)
        {
            GameState game = new GameState();

            while (true)
            {
                game.Draw();
                ConsoleKeyInfo consoleKeyInfo = Console.ReadKey();
                game.ProcessKeyEvent(consoleKeyInfo);
            }
        }
Example #4
0
        static void Main(string[] args)
        {
            GameState gameState = new GameState();

            while (!end)
            {
                gameState.Draw();
                ConsoleKeyInfo consoleKeyInfo = Console.ReadKey();
                gameState.PressedKey(consoleKeyInfo);
            }
        }
Example #5
0
        static void Main(string[] args)
        {
            GameState.EnterName();
            Console.CursorVisible = false;
            Console.Clear();

            GameState gameState = new GameState();

            while (true)
            {
                gameState.Draw();
                gameState.draw_comments();
                ConsoleKeyInfo consoleKeyInfo = Console.ReadKey();
                gameState.PressedKey(consoleKeyInfo);
            }
        }
Example #6
0
        static void Main(string[] args)
        {
            GameState game = new GameState();

            Console.WriteLine("Your name");
            string name = Console.ReadLine();

            Console.Clear();


            while (true)
            {
                game.Draw();
                ConsoleKeyInfo consoleKeyInfo = Console.ReadKey();
                game.PressedKey(consoleKeyInfo);
                Console.SetCursorPosition(1, 32);
                int score = game.Score();
                int level = game.Level();
                Console.Write("Player {0}  Score  {1}  Level {2}", name, score, level);
            }
        }