From 4e7d631e4202dd961ed9fbfb4e15cc45ea718979 Mon Sep 17 00:00:00 2001 From: filifa Date: Tue, 19 Mar 2024 20:38:20 -0500 Subject: [PATCH] Remove call to update_mine_counter() from the main loop --- board.py | 2 ++ main.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/board.py b/board.py index 4807660..6da1629 100644 --- a/board.py +++ b/board.py @@ -34,6 +34,7 @@ class Board: self.mine_counter = self.game_font.render(str(mines), True, (255,0,0)) self.counter_loc = self.mine_counter.get_rect() self.counter_loc.bottomleft = self.square_grid.topleft + self.update_mine_counter() # Places the timer self.timer = self.game_font.render("999", True, (255,0,0)) @@ -185,3 +186,4 @@ class Board: self.total_flags += 1 elif square.is_questioned: self.total_flags -= 1 + self.update_mine_counter() diff --git a/main.py b/main.py index 42885e6..247fbad 100755 --- a/main.py +++ b/main.py @@ -29,7 +29,6 @@ def play_game(rows, cols, mines): pygame.time.set_timer(UPDATETIMER, 100) while True: - board.update_mine_counter() board.check_for_win() pygame.display.update()