Ejemplo n.º 1
0
        private static void NewGame()
        {
            while (true)
            {
                GameEngine game = new GameEngine();


                while (game.SomeoneHasWon() == false) //GameLoop
                {
                    foreach (Player player in game.Players)
                    {
                        game.PrintGrid(player);
                        ConsoleKeyInfo keyPressed;
                        do
                        {
                            keyPressed = Console.ReadKey(false);
                        } while (!game.KeyPressIsValid(keyPressed));
                        game.TryMovePlayer(player, keyPressed);

                        if (game.SomeoneHasWon())
                        {
                            PrintEngine.PrintWinScreen(game.Players);
                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public void PrintGrid(ConsoleColor color, Player player) // Målar upp rutnätet inkl spelare och mål (olika färger?)
 {
     PrintEngine.PrintGrid(color, Players, Targets, Grid, player);
 }