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
[x] Test to ensure streak is broken
[x] Test to ensure 'lost' functionality is intact
[x] Test for darkmode
[x] Test for responsiveness
[x] Test on Firefox
[x] Test on Chrome
[x] Test on Safari
[x] Test on Android (Firefox)
[x] Test on iOS (Safari)
Benign bugs to fix in future:
[Fixed in a new commit] If the wordle is completed within 40s, the next puzzle shows Give Up button much sooner (i.e. timer is not reset)
Timer starts running even when user is in InfoModal
[Fixed in a new commit] Closing EndGameModal using x instead of Play Again will have a redundant functionless Give Up button until the next game is started
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
https://user-images.githubusercontent.com/25542635/154793543-ef9f85b3-7fbc-4966-a479-b0219532f6b6.mp4
Addresses issue #124 cc: @octokatherine