Example #1
0
 public static void StartGame()
 {
     Menu();
     PlayerStart();
     AIStart();
     GridGeneration.UpdateField();
     GridGenerationAI.UpdateFieldAI();
 }
Example #2
0
 public static void Shoot(int height, int width, char bullet)
 {
     Console.Clear();
     ShootInPlayer(height, width, bullet);
     GridGenerationAI.UpdateFieldAI();
     if (bullet == '#')
     {
         AIInteraction.Attack();
         Logic.wasHittedFromAI();
     }
 }
Example #3
0
 public static void wasHittedFromPlayer()
 {
     for (int y = 0; y < GridGeneration.height; y++)
     {
         for (int j = 0; j < GridGeneration.width; j++)
         {
             if (PlayerInteraction.attackHeight == y && PlayerInteraction.attackWidth == j)
             {
                 if (GridGenerationAI.field[y, j] == '!')
                 {
                     GridGenerationAI.Shoot(y, j, '#');
                     UI.WriteASentence(ConsoleColor.Cyan, "You ve hit!");
                 }
                 else
                 {
                     GridGenerationAI.Shoot(y, j, '^');
                     UI.WriteASentence(ConsoleColor.Cyan, "You havent hit!");
                 }
             }
         }
     }
 }
Example #4
0
        public static void GenerateShip(int size, int[] height, int width)
        {
            Ship ship = new Ship(size, height, width);

            GridGenerationAI.DrawAI(height, width, size);
        }
Example #5
0
 private static void AIStart()
 {
     GridGenerationAI.GenerateFieldAI();
     ShipGenerationAI.CreateShips(7);
 }