-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershacktoberfest
Description
Project slug (e.g., snake, todo)
No response
Summary
Let's build the classic "Hangman" word-guessing game. This version will be for two players: one player enters a secret word, and the second player tries to guess it. This project is excellent for practicing DOM manipulation, handling user events (like keyboard clicks), and managing game state.
Core Features (User Stories):
Phase 1: Word Setup
- The game first asks Player 1 to enter a secret word.
- The input for the secret word should be hidden (like a password field) so Player 2 can't see it.
- After Player 1 submits the word, this setup screen is hidden, and the main game board appears.
Phase 2: Guessing
- The game board should display a series of underscores (
_ _ _ _), one for each letter in the secret word. - An on-screen alphabet keyboard (A-Z) should be shown for Player 2 to click and guess letters.
- When Player 2 clicks a letter:
- If the letter is in the secret word, all instances of that letter are revealed (e.g.,
_ P P _ E). - If the letter is not in the secret word, the number of "Wrong Guesses" increases by one.
- The clicked letter on the on-screen keyboard should be disabled so it can't be guessed again.
- If the letter is in the secret word, all instances of that letter are revealed (e.g.,
Phase 3: Game End
- The game tracks the number of wrong guesses (e.g., 6 tries).
- If Player 2 guesses all the letters in the word before running out of tries, a "You Win!" message is shown.
- If Player 2 runs out of tries, a "You Lose!" message is shown, and the secret word is revealed.
- A "Play Again" button should appear to reset the game back to Phase 1.
Details / Acceptance criteria
No response
Scope
- UI changes
- Logic changes
- Accessibility
- Tests (manual)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershacktoberfest