-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jeu qui est-ce? /Guess who project #333
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done! I didn't encounter any bugs apart from the sound bug (which you mentioned in the description) at the start.
I like all the features you added like sounds, additional categories in the drop-down menu, name prompt and the counter for number of guesses. The card-flipping animation was really cool as well. All in all, these additions improve the user experience!
Nice solution for bypassing the bug where the default option (index[0]) couldn't be selected as the first guess.
I think the rules for the name input was interesting to see. At first I wasn't sure if they were too restrictive but I think they are okay. In all the games I have played there have been similar restrictions especially regarding what characters are allowed.
<link rel="shortcut icon" href="#"> | ||
|
||
- when selecting "brown hair" found at option [0], no change event is detected by the eventlistener -skipping the whole <selectQuestion> function, not passing the values <category> and <value> in <checkQuestion> (undefined) -<findOutbutton> does not react. | ||
Also, an action on the board game predetermined by the option selected in the menu is activated only when the <findOutbutton> is clicked, and not the <change> event itself, thus making the eventlisterner <change> irrelevant if the <selectQuestion> is invoked directly in next <checkQuestion> function triggered by <findOutbutton> + erasing <questions.addEventListener('change', selectQuestion)> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a nice alternative to changing the default value in the drop-down menu!
//Function to add user's name after a prompt message: | ||
const addUserName = () => { | ||
playerName = prompt(`Welcome to the game Guess who! Please enter your name:`) | ||
const regex = /^[a-zA-Z]{2,}$/g; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have not seen this line of code before but I noticed after some testing that you can't enter a name unless it has more than two letters and some characters aren't allowed, so I'm guessing this is what sets up the rules for the name input. Had to do a bit of googling to understand it and learned something new! :)
const generateBoard = () => { | ||
board.innerHTML = '' | ||
charactersInPlay.forEach((person) => { | ||
const shuffle = new Audio('./assets/shuffle.wav'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sound effects are a nice addition!
position: relative; | ||
width: 100%; | ||
height: 100%; | ||
transition: transform 0.6s; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition of the animation!
Deployed project:
https://guess-who-gleeful-kitsune.netlify.app/