/// <summary> /// Method that defines a NPC attack. /// </summary> /// <param name="grid">Game grid.</param> /// <param name="p">Current player in game.</param> public void Fight(GridManager grid, Player p) { // Set Damage of NPC Damage = rnd.NextDouble() * AP; // Take health from player according to Damage of NPC p.Health -= Damage; // Verify if player is dead p.Die(grid); }
/// <summary> /// Method that Loops through all the game actions. /// </summary> public void GameLoop() { // Variable to keep the game loop going bool endGame = false; // GameLoop while (!endGame) { // Render the game grid render.RenderBoard(grid, player); // Ask for player input player.PlayerController(grid); // Update the game grid.Update(player); //Call method to make sure player is not dead player.Die(grid); } }