Implementing the Give Up button #124 #125
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implementing the Give Up button. Resolves #124.
Play with the deployed version of this PR here: https://wordlgiveup.herokuapp.com (supports Desktop and Mobile)
Motivation
When you are out of words to guess, rather than filling in the remaining words in vain, give up and move on to next puzzle quicker.
Button Timing Details
Since showing a button that says
Give Up
from the start of a puzzle is annoying, it only appears 40s after each new puzzle is loaded. Reloading the page resets this timer.Button Behavior
When clicked, it behaves as if the game is lost. That is, it resets the streak and sets the gameState to 'lost', thereby opening the EndGameModal.
Manual Testing
Benign bugs to fix in future:
If the wordle is completed within 40s, the next puzzle showsGive Up
button much sooner (i.e. timer is not reset)Closing EndGameModal usingx
instead ofPlay Again
will have a redundant functionlessGive Up
button until the next game is startedFeature Video
wordlTesting.mp4
Addresses issue #124
cc: @octokatherine