Hangman Game
This is a classic word-guessing game built using React and Gemini AI.
What it does
The game follows the traditional rules of Hangman, where players try to reveal a hidden word by guessing one letter at a time. Incorrect guesses result in a part of a stick figure being drawn, and the game ends when the figure is fully drawn or the word is successfully guessed.
Key Features:
1. User Interface: The game's UI is built with React, ensuring a dynamic and responsive experience.
2. Word Generation: The Gemini AI API is leveraged to generate random words for each game session. This adds an element of unpredictability and challenge, as players encounter a wide range of words.
3. Game Logic: The game logic is managed using React's state and effect hooks.
4. Feedback and Interactions: Players receive immediate visual feedback for their guesses.
5. Game Over Conditions: The game checks for win or loss conditions after each guess, updating the UI to display a message and offering the option to start a new game.
Using Gemini API:
1. Fetching Words: Upon starting a new game, the React component makes an API call to Gemini AI to fetch a random word. The word is then set as the target word for the game.
2. API Integration: The integration with Gemini API is done using Axios for making HTTP requests.
3. Error Handling: Error handling is implemented to manage cases where the API call fails, ensuring the game can gracefully handle such scenarios and provide appropriate feedback to the user.
Built with
- Web/Chrome
Team
By
Matin Imam
From
India