mirror of
https://github.com/kristoferssolo/2048.git
synced 2025-10-21 15:20:35 +00:00
docs(game): update docstrings
This commit is contained in:
parent
692d5dd859
commit
4b02daf12b
@ -31,6 +31,7 @@ class Game:
|
||||
self.move_down()
|
||||
|
||||
def move(self, direction: Direction) -> None:
|
||||
"""Moved the board in the given direction and updates the score."""
|
||||
self.board.move(direction)
|
||||
self.header.update(self.board.score)
|
||||
|
||||
|
||||
@ -42,9 +42,8 @@ class Header:
|
||||
return pygame.sprite.Group(self.score, highscore)
|
||||
|
||||
def draw(self, surface: pygame.Surface) -> None:
|
||||
"""Draw the header."""
|
||||
self.labels.draw(surface)
|
||||
|
||||
def update(self, score: int) -> None:
|
||||
"""Update the score."""
|
||||
self.score.update_score(score)
|
||||
def update(self, new_score: int) -> None:
|
||||
"""Updates the score to `new_score`."""
|
||||
self.score.update_score(new_score)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user