Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Nextlvl.Deserialize();
            GameState game = new GameState();

            if (Returnlvl.count == 1)
            {
                Butter.username = Returnlvl.login;
                Butter.score    = Returnlvl.score;
                Savescore.Deserialize();
                Console.Clear();

                game.Run2();

                while (true)
                {
                    if (Butter.gameOver)
                    {
                        GameState.gameover();
                    }
                    game.DrawScore();

                    ConsoleKeyInfo consoleKeyInfo = Console.ReadKey();
                    game.ProcessKeyEvent(consoleKeyInfo);
                }
            }
            else
            {
                Console.WriteLine("Champions:");
                Savescore.Deserialize();
                DesOutput.PrintScore();
                Console.WriteLine("Enter username:");
                Butter.username = Console.ReadLine();
                Console.Clear();
                game.Run();


                while (true)
                {
                    if (Butter.gameOver)
                    {
                        GameState.gameover();
                    }
                    ConsoleKeyInfo consoleKeyInfo = Console.ReadKey();
                    game.ProcessKeyEvent(consoleKeyInfo);
                    game.DrawScore();
                }
            }
        }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
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);
                }
            }
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            GameState game = new GameState();

            while (true)
            {
                game.Draw();
                ConsoleKeyInfo consoleKeyInfo = Console.ReadKey();
                game.ProcessKeyEvent(consoleKeyInfo);
            }
        }
Ejemplo n.º 5
0
        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);
                }
            }
        }