public static void StartGame() { Menu(); PlayerStart(); AIStart(); GridGeneration.UpdateField(); GridGenerationAI.UpdateFieldAI(); }
public static void Shoot(int height, int width, char bullet) { Console.Clear(); ShootInPlayer(height, width, bullet); GridGenerationAI.UpdateFieldAI(); if (bullet == '#') { AIInteraction.Attack(); Logic.wasHittedFromAI(); } }
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!"); } } } } }
public static void GenerateShip(int size, int[] height, int width) { Ship ship = new Ship(size, height, width); GridGenerationAI.DrawAI(height, width, size); }
private static void AIStart() { GridGenerationAI.GenerateFieldAI(); ShipGenerationAI.CreateShips(7); }