From de7afa3df1f8c8011a910db84bdc74450771ad9b Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Mon, 1 Jan 2024 20:22:56 +0200 Subject: [PATCH] feat(game): add `is_game_over` method --- src/py2048/board.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/py2048/board.py b/src/py2048/board.py index 05d7d03..b8654f0 100644 --- a/src/py2048/board.py +++ b/src/py2048/board.py @@ -79,3 +79,6 @@ class Board(pygame.sprite.Group): return True return False + def is_game_over(self) -> bool: + """Check if the game is over.""" + return self._is_full() and not self._can_move()