Beispiel #1
0
 public static void StartGame()
 {
     Menu();
     PlayerStart();
     AIStart();
     GridGeneration.UpdateField();
     GridGenerationAI.UpdateFieldAI();
 }
Beispiel #2
0
 public static void Shoot(int height, int width, char bullet)
 {
     GridGeneration.UpdateField();
     ShootInAI(height, width, bullet);
     if (bullet == '#' && !GameCycle.isgameEnded)
     {
         PlayerInteraction.Attack();
         Logic.wasHittedFromPlayer();
     }
 }
Beispiel #3
0
 public static void wasHittedFromAI()
 {
     for (int y = 0; y < GridGeneration.height; y++)
     {
         for (int j = 0; j < GridGeneration.width; j++)
         {
             if (AIInteraction.attackHeight == y && AIInteraction.attackWidth == j)
             {
                 if (GridGeneration.field[y, j] == '!')
                 {
                     GridGeneration.Shoot(y, j, '#');
                     UI.WriteASentence(ConsoleColor.Cyan, "Enemy have hit!");
                 }
                 else
                 {
                     GridGeneration.Shoot(y, j, '^');
                     UI.WriteASentence(ConsoleColor.Cyan, "Enemy havent hit!");
                 }
             }
         }
     }
 }
Beispiel #4
0
 private static void PlayerStart()
 {
     GridGeneration.GenerateField();
     ShipGeneration.CreateShips(7);
 }
Beispiel #5
0
        public static void GenerateShip(int size, int[] height, int width)
        {
            Ship ship = new Ship(size, height, width);

            GridGeneration.Draw(height, width, size);
        }