Welcome to The-Hangman, a visually appealing and interactive Hangman game built by me for my C class project using SDL2 and SDL2_ttf libraries. This project showcases a classic word-guessing game with enhanced graphics and animations to provide an engaging user experience.
- Colorful and Animated Hangman Figure: The Hangman figure is drawn with vibrant colors and simple animations.
- Case-Insensitive Word Guessing: The game handles both uppercase and lowercase letters seamlessly.
- User-Friendly Interface: Clear and intuitive interface with prompts and messages.
- Customizable Background: Option to add a background image for a more immersive experience.
- Welcome Screen: Includes a welcome screen with a larger Hangman figure and game title.
- SDL2: Simple DirectMedia Layer library.
- SDL2_ttf: TrueType font rendering library for SDL2.
-
Clone the repository:
git clone https://github.com/swopnil7/Hangman-SDL-C.git cd Hangman-SDL-C -
Ensure the SDL2 and SDL2_ttf libraries are in the correct directories:
-
Compile the project using
gcc:gcc -o hangman src/main.c src/game.c src/renderer.c -I./src/include/SDL2 -L./src/lib -lmingw32 -lSDL2main -lSDL2 -lSDL2_ttf
-
Run the compiled program:
./hangman
- Welcome Screen: Press any key to start the game.
- Enter Word: Type the word to be guessed (letters will be hidden).
- Guess Letters: Use the keyboard to guess letters. The game will indicate correct and incorrect guesses.
- Win/Lose: The game will display a "You won!" or "You lost!" message based on the outcome.
Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.
- SDL2: Simple DirectMedia Layer
- SDL2_ttf: SDL_ttf Library
For any questions or suggestions, feel free to reach out to me.
Enjoy playing Hangman-SDL-C!

