mirror of
https://github.com/kristoferssolo/Tetris.git
synced 2025-10-21 20:00:35 +00:00
feat(game): add mute
This commit is contained in:
parent
9aae271bf4
commit
33554bf0e0
@ -142,6 +142,10 @@ class Game:
|
|||||||
self._reset_game_state()
|
self._reset_game_state()
|
||||||
self._initialize_field_and_tetromino()
|
self._initialize_field_and_tetromino()
|
||||||
|
|
||||||
|
def mute(self) -> None:
|
||||||
|
"""Mute the game."""
|
||||||
|
self.landing_sound.set_volume(0)
|
||||||
|
|
||||||
def _draw_grid(self) -> None:
|
def _draw_grid(self) -> None:
|
||||||
"""Draw the grid on the game surface."""
|
"""Draw the grid on the game surface."""
|
||||||
for col in range(1, CONFIG.game.columns):
|
for col in range(1, CONFIG.game.columns):
|
||||||
|
|||||||
@ -54,6 +54,11 @@ class Main:
|
|||||||
pygame.quit()
|
pygame.quit()
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
def mute(self) -> None:
|
||||||
|
"""Mute the game."""
|
||||||
|
self.music.set_volume(0)
|
||||||
|
self.game.mute()
|
||||||
|
|
||||||
def _update_score(self, lines: int, score: int, level: int) -> None:
|
def _update_score(self, lines: int, score: int, level: int) -> None:
|
||||||
"""
|
"""
|
||||||
Update the game score.
|
Update the game score.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user