mirror of
https://github.com/kristoferssolo/2048.git
synced 2025-10-21 15:20:35 +00:00
feat(game): add restart method
This commit is contained in:
parent
de7afa3df1
commit
461c27e2d3
@ -82,3 +82,8 @@ class Board(pygame.sprite.Group):
|
|||||||
def is_game_over(self) -> bool:
|
def is_game_over(self) -> bool:
|
||||||
"""Check if the game is over."""
|
"""Check if the game is over."""
|
||||||
return self._is_full() and not self._can_move()
|
return self._is_full() and not self._can_move()
|
||||||
|
|
||||||
|
def restart(self) -> None:
|
||||||
|
"""Restart the game."""
|
||||||
|
self.empty()
|
||||||
|
self.generate_initial_blocks()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user