mirror of
https://github.com/kristoferssolo/2048.git
synced 2025-10-21 15:20:35 +00:00
feat(game): add move_right
This commit is contained in:
parent
9e073c5bea
commit
6343445add
@ -59,8 +59,14 @@ class Game2048:
|
||||
def move_left(self) -> None:
|
||||
pass
|
||||
|
||||
def move_right(self) -> None:
|
||||
pass
|
||||
def move_right(self) -> tuple[bool, int]:
|
||||
self.board, has_pushed = self._push_board_right()
|
||||
has_merged = self.merge()
|
||||
self.board, _ = self._push_board_right()
|
||||
move_made = has_pushed or has_merged
|
||||
if move_made:
|
||||
self.add_random_tile()
|
||||
return move_made, self.score
|
||||
|
||||
def move_up(self) -> None:
|
||||
pass
|
||||
|
||||
Loading…
Reference in New Issue
Block a user