mirror of
https://github.com/kristoferssolo/2048.git
synced 2026-02-04 05:52:03 +00:00
feat(game): add restart method
This commit is contained in:
@@ -82,3 +82,8 @@ class Board(pygame.sprite.Group):
|
||||
def is_game_over(self) -> bool:
|
||||
"""Check if the game is over."""
|
||||
return self._is_full() and not self._can_move()
|
||||
|
||||
def restart(self) -> None:
|
||||
"""Restart the game."""
|
||||
self.empty()
|
||||
self.generate_initial_blocks()
|
||||
|
||||
Reference in New Issue
Block a user