Closed zurda closed 4 years ago
Hi! Can I work on this issue?
Sure thing, @miguelcarvalho13 . Worth noting that we've changed the styling so I updated the visuals and description in this ticket.
I edited the description, so now there are 2 suggestions on how the hint feature could be improved. Feel free to only do one or the other. If you do both suggestions - feel free to do them in seperate PRs.
I hope this makes sense?
Thanks!
It totally makes sense! I'll try to do both and I think I'm going to start with the option of Change hint location so it doesn't always get the top left corner
.
I'm a bit new to react so if I need help I'll get back to here 😄
Sure thing, and no worries. Let me know if you need help, and we can figure it out together. There's probably more than one way to do this (to be honest, I feel like I initially put a randomiser to the location of the hint so not sure if it never worked or if it stopped working at some point 😂)
(to be honest, I feel like I initially put a randomiser to the location of the hint so not sure if it never worked or if it stopped working at some point 😂)
I totally know that feeling 🤣
I didn't found a randomizer for the hint already in the code but I actually found a function that gets a random number (getRandom
) and did this PR https://github.com/zurda/hangman-react/pull/24 using that function.
Something that I didn't understand was that there was a component called PosterHint.tsx
but it didn't seem to be used so the place I changed was inside the GameBoard.tsx
Oh, that's a good point @miguelcarvalho13 , thanks for letting me know. There might be some cleaning up needed - I'll add an issue for cleaning up unused libraries/ unused components.
And thank you for the PR - works like a charm. I'm leaving this open for the second subtask
Thank you! 🎉
I'll try to work on the second one (Add ability to get a second hint
)
Just tried to do the second one in this PR https://github.com/zurda/hangman-react/pull/28 Let me know if there's something to change 😄
Looks great, thanks for contributing 🙌
Thank you too!! 🤗
Purpose
Improve Hint feature
Current behaviour:
When you click the hint button, you get a part of the movie poster displayed in the UI. If the movie poster hint isn't helpful, we should allow the user to get another movie poster for 1 guess.
First suggestion:
So, if getting the hint (movie poster) "costs" the user 2 guesses, then getting another movie poster should "cost" one guess.
Once the user requested another hint, we need to randomly select and display another section of the movie poster.
Second suggestion:
Right now the movie poster hint always show the top left corner of the poster. We should randomally choose a section of the poster to improve the users chances
Feel free to create a PR for either of these suggestions, or two PR for each (you don't have to do both).