Hangman web game to apply js fundamentals a# Hangman Game
A fun, web-based implementation of the classic Hangman word guessing game.
- Multiple Word Categories: Choose from Animals, Countries, Fruits, or Sports
- Intuitive Interface: Clean, responsive design works on both desktop and mobile devices
- Visual Hangman Drawing: SVG-based drawing that updates with each wrong guess
- Scoring System: Track your successful guesses
- Keyboard Support: Use your physical keyboard or the on-screen buttons
- Select a category from the dropdown menu
- Try to guess the hidden word by clicking letters on the virtual keyboard
- Each correct guess reveals that letter in the word
- Each incorrect guess adds a part to the hangman drawing
- Win by correctly guessing the entire word before the hangman is complete
- Lose if the hangman drawing completes before you guess the word
- Press "New Game" to start a new round
- You have 6 incorrect guesses before losing
- Each correct guess reveals all instances of that letter in the word
- Your score increases by 10 points for each winning game
- Already guessed letters are disabled on the keyboard
This game is built using:
- HTML5
- CSS3 (with CSS Variables)
- Vanilla JavaScript
- SVG for the hangman drawing
No external libraries or frameworks are required to run the game.
- Download the HTML file
- Open it in any modern web browser (Chrome, Firefox, Safari, Edge)
That's it! No server or installation needed.
The game works in all modern browsers that support ES6 JavaScript features:
- Chrome (version 58+)
- Firefox (version 54+)
- Safari (version 10+)
- Edge (version 15+)
You can easily modify the game by:
- Adding new word categories in the JavaScript
categoriesobject - Changing the CSS variables to customize the color scheme
- Modifying the SVG drawing to change the hangman visualization
- Adjusting the
maxWrongGuessesvariable to make the game easier or harder
This project is free to use, modify and distribute for personal or educational purposes.
- Inspired by the classic Hangman paper and pencil game
- Created as a fun way to practice vocabulary and spelling