1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 01:27:44 +00:00

2048: Let user decide if he wants to continue the game

Before game finish when a player has reached target tile,
Now player will be able to decide if he wants to continue or not
This commit is contained in:
Mohsan Ali 2021-10-04 22:57:13 +05:00 committed by Ali Mohammad Pur
parent accf4b338d
commit d609dde7b0
3 changed files with 18 additions and 8 deletions

View file

@ -232,7 +232,7 @@ Game::MoveOutcome Game::attempt_move(Direction direction)
add_tile();
}
if (is_complete(m_board, m_target_tile))
if (is_complete(m_board, m_target_tile) && !m_want_to_continue)
return MoveOutcome::Won;
if (m_board.is_stalled())
return MoveOutcome::GameOver;